xref: /illumos-gate/usr/src/cmd/perl/Makefile.targ (revision d7e2bdfa66e3574ffcce3665a4cd1136fc6cb6a1)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11#
12# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
13# Copyright (c) 2016 Racktop Systems.
14# Copyright (c) 2018, Joyent, Inc.
15
16# Link against libc as per solaris specs
17$(PERLEXT):= PICS = $(MACH)/$(MODULE).o
18$(PERLEXT):= LDLIBS += -lc
19$(PERLEXT64):= PICS = $(MACH64)/$(MODULE).o
20$(PERLEXT64):= LDLIBS += -lc
21
22# Allow for undefined symbols satisfied by perl
23$(PERLEXT):= ZDEFS =
24$(PERLEXT64):= ZDEFS =
25
26$(ROOTPERLEXT) := FILEMODE = 0555
27$(ROOTPERLMOD) := FILEMODE = 0444
28$(ROOTPERLEXT64) := FILEMODE = 0555
29$(ROOTPERLMOD64) := FILEMODE = 0444
30
31# CFLAGS for perl, specifically.
32PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
33	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
34PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \
35	 -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
36
37SMATCH=off
38
39$(MACH) $(MACH64):
40	$(INS.dir)
41
42$(PERLEXT): $(MACH)/$(MODULE).o
43	$(BUILD.SO)
44
45$(PERLEXT64): $(MACH64)/$(MODULE).o
46	$(BUILD64.SO)
47
48$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
49	$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
50
51$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c
52	$(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@
53
54$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs
55	$(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
56
57$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
58	$(XSUBPP64) $(XSUBPPFLAGS64) $(MODULE).xs >$@
59
60$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
61	$(INS.dir)
62
63$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
64	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
65
66$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm
67	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
68
69$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64):
70	$(INS.dir)
71
72$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
73	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
74
75$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so
76	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
77