xref: /illumos-gate/usr/src/cmd/perl/Makefile.targ (revision 9894d69ccc165ef74bf6ccce5a722cdefc922f18)
1c9f77c52SAndy Stormont#
2c9f77c52SAndy Stormont# This file and its contents are supplied under the terms of the
3c9f77c52SAndy Stormont# Common Development and Distribution License ("CDDL"), version 1.0.
4c9f77c52SAndy Stormont# You may only use this file in accordance with the terms of version
5c9f77c52SAndy Stormont# 1.0 of the CDDL.
6c9f77c52SAndy Stormont#
7c9f77c52SAndy Stormont# A full copy of the text of the CDDL should have accompanied this
8c9f77c52SAndy Stormont# source.  A copy of the CDDL is also available via the Internet at
9c9f77c52SAndy Stormont# http://www.illumos.org/license/CDDL.
10c9f77c52SAndy Stormont#
11c9f77c52SAndy Stormont#
121f2ca518SDan McDonald# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
130ae9a84fSAndrew Stormont# Copyright (c) 2016 Racktop Systems.
145661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
15c9f77c52SAndy Stormont
160ae9a84fSAndrew Stormont# Link against libc as per solaris specs
17*9894d69cSRobert Mustacchi$(PERLEXT):= PICS = $(MACH)/$(MODULE).o
18c9f77c52SAndy Stormont$(PERLEXT):= LDLIBS += -lc
19*9894d69cSRobert Mustacchi$(PERLEXT64):= PICS = $(MACH64)/$(MODULE).o
200ae9a84fSAndrew Stormont$(PERLEXT64):= LDLIBS += -lc
21c9f77c52SAndy Stormont
22c9f77c52SAndy Stormont# Allow for undefined symbols satisfied by perl
23c9f77c52SAndy Stormont$(PERLEXT):= ZDEFS =
240ae9a84fSAndrew Stormont$(PERLEXT64):= ZDEFS =
25c9f77c52SAndy Stormont
26c7893124SRichard Lowe$(ROOTPERLEXT) := FILEMODE = 0555
27c7893124SRichard Lowe$(ROOTPERLMOD) := FILEMODE = 0444
280ae9a84fSAndrew Stormont$(ROOTPERLEXT64) := FILEMODE = 0555
290ae9a84fSAndrew Stormont$(ROOTPERLMOD64) := FILEMODE = 0444
30c7893124SRichard Lowe
3174515eeeSDan McDonald# CFLAGS for perl, specifically.
321f2ca518SDan McDonaldPCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
331f2ca518SDan McDonald	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
340ae9a84fSAndrew StormontPCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \
350ae9a84fSAndrew Stormont	 -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
3674515eeeSDan McDonald
375661bb76SJohn LevonSMATCH=off
385661bb76SJohn Levon
390ae9a84fSAndrew Stormont$(MACH) $(MACH64):
40c9f77c52SAndy Stormont	$(INS.dir)
41c9f77c52SAndy Stormont
42c9f77c52SAndy Stormont$(PERLEXT): $(MACH)/$(MODULE).o
43*9894d69cSRobert Mustacchi	$(BUILD.SO)
44c9f77c52SAndy Stormont
450ae9a84fSAndrew Stormont$(PERLEXT64): $(MACH64)/$(MODULE).o
46*9894d69cSRobert Mustacchi	$(BUILD64.SO)
470ae9a84fSAndrew Stormont
48c9f77c52SAndy Stormont$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
4974515eeeSDan McDonald	$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
50c9f77c52SAndy Stormont
510ae9a84fSAndrew Stormont$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c
520ae9a84fSAndrew Stormont	$(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@
53c9f77c52SAndy Stormont
540ae9a84fSAndrew Stormont$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs
550ae9a84fSAndrew Stormont	$(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
560ae9a84fSAndrew Stormont
570ae9a84fSAndrew Stormont$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
580ae9a84fSAndrew Stormont	$(XSUBPP64) $(XSUBPPFLAGS64) $(MODULE).xs >$@
590ae9a84fSAndrew Stormont
600ae9a84fSAndrew Stormont$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
61c9f77c52SAndy Stormont	$(INS.dir)
62c9f77c52SAndy Stormont
63c9f77c52SAndy Stormont$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
64c9f77c52SAndy Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
65c9f77c52SAndy Stormont
660ae9a84fSAndrew Stormont$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm
670ae9a84fSAndrew Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
680ae9a84fSAndrew Stormont
690ae9a84fSAndrew Stormont$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64):
70c9f77c52SAndy Stormont	$(INS.dir)
71c9f77c52SAndy Stormont
72c9f77c52SAndy Stormont$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
73c9f77c52SAndy Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
740ae9a84fSAndrew Stormont
750ae9a84fSAndrew Stormont$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so
760ae9a84fSAndrew Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
77