xref: /illumos-gate/usr/src/cmd/perl/Makefile.targ (revision 5661bb7641e85c46713da7a3002b29ecd2c3daf0)
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#
12c9f77c52SAndy Stormont# Copyright (c) 2014 Racktop Systems.
131f2ca518SDan McDonald# Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
14*5661bb76SJohn Levon# Copyright (c) 2018, Joyent, Inc.
15c9f77c52SAndy Stormont
16c9f77c52SAndy Stormont# Link against libc as perl solaris specs
17c9f77c52SAndy Stormont$(PERLEXT):= LDLIBS += -lc
18c9f77c52SAndy Stormont
19c9f77c52SAndy Stormont# Allow for undefined symbols satisfied by perl
20c9f77c52SAndy Stormont$(PERLEXT):= ZDEFS =
21c9f77c52SAndy Stormont
22c7893124SRichard Lowe$(ROOTPERLEXT) := FILEMODE = 0555
23c7893124SRichard Lowe$(ROOTPERLMOD) := FILEMODE = 0444
24c7893124SRichard Lowe
2574515eeeSDan McDonald# CFLAGS for perl, specifically.
261f2ca518SDan McDonaldPCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
271f2ca518SDan McDonald	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
2874515eeeSDan McDonald
29*5661bb76SJohn LevonSMATCH=off
30*5661bb76SJohn Levon
31c9f77c52SAndy Stormont$(MACH):
32c9f77c52SAndy Stormont	$(INS.dir)
33c9f77c52SAndy Stormont
34c9f77c52SAndy Stormont$(PERLEXT): $(MACH)/$(MODULE).o
35c9f77c52SAndy Stormont	$(BUILD.SO) $(MACH)/$(MODULE).o
36c9f77c52SAndy Stormont
37c9f77c52SAndy Stormont$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
3874515eeeSDan McDonald	$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
39c9f77c52SAndy Stormont
40c9f77c52SAndy Stormont$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs
41c9f77c52SAndy Stormont	$(PERLDIR)/bin/xsubpp $(XSUBPPFLAGS) $(MODULE).xs >$@
42c9f77c52SAndy Stormont
43c9f77c52SAndy Stormont$(ROOTPERLMODDIR):
44c9f77c52SAndy Stormont	$(INS.dir)
45c9f77c52SAndy Stormont
46c9f77c52SAndy Stormont$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
47c9f77c52SAndy Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
48c9f77c52SAndy Stormont
49c9f77c52SAndy Stormont$(ROOTPERLEXTDIR):
50c9f77c52SAndy Stormont	$(INS.dir)
51c9f77c52SAndy Stormont
52c9f77c52SAndy Stormont$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
53c9f77c52SAndy Stormont	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
54