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