xref: /titanic_52/usr/src/cmd/perl/Makefile.targ (revision 941d8a6ea975201934fe21514a2bad8cbd907495)
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#
15
16# Link against libc as per solaris specs
17$(PERLEXT):= LDLIBS += -lc
18$(PERLEXT64):= LDLIBS += -lc
19
20# Allow for undefined symbols satisfied by perl
21$(PERLEXT):= ZDEFS =
22$(PERLEXT64):= ZDEFS =
23
24$(ROOTPERLEXT) := FILEMODE = 0555
25$(ROOTPERLMOD) := FILEMODE = 0444
26$(ROOTPERLEXT64) := FILEMODE = 0555
27$(ROOTPERLMOD64) := FILEMODE = 0444
28
29# CFLAGS for perl, specifically.
30PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
31	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
32PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \
33	 -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
34
35$(MACH) $(MACH64):
36	$(INS.dir)
37
38$(PERLEXT): $(MACH)/$(MODULE).o
39	$(BUILD.SO) $(MACH)/$(MODULE).o
40
41$(PERLEXT64): $(MACH64)/$(MODULE).o
42	$(BUILD64.SO) $(MACH64)/$(MODULE).o
43
44$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
45	$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
46
47$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c
48	$(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@
49
50$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs
51	$(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
52
53$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
54	$(XSUBPP64) $(XSUBPPFLAGS64) $(MODULE).xs >$@
55
56$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
57	$(INS.dir)
58
59$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
60	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
61
62$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm
63	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
64
65$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64):
66	$(INS.dir)
67
68$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
69	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
70
71$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so
72	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
73