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. 13*4c1e9c66SAndrew Stormont# Copyright (c) 2016 Racktop Systems. 14c9f77c52SAndy Stormont# 15c9f77c52SAndy Stormont 16*4c1e9c66SAndrew Stormont# Link against libc as per solaris specs 17c9f77c52SAndy Stormont$(PERLEXT):= LDLIBS += -lc 18*4c1e9c66SAndrew Stormont$(PERLEXT64):= LDLIBS += -lc 19c9f77c52SAndy Stormont 20c9f77c52SAndy Stormont# Allow for undefined symbols satisfied by perl 21c9f77c52SAndy Stormont$(PERLEXT):= ZDEFS = 22*4c1e9c66SAndrew Stormont$(PERLEXT64):= ZDEFS = 23c9f77c52SAndy Stormont 24c7893124SRichard Lowe$(ROOTPERLEXT) := FILEMODE = 0555 25c7893124SRichard Lowe$(ROOTPERLMOD) := FILEMODE = 0444 26*4c1e9c66SAndrew Stormont$(ROOTPERLEXT64) := FILEMODE = 0555 27*4c1e9c66SAndrew Stormont$(ROOTPERLMOD64) := FILEMODE = 0444 28c7893124SRichard Lowe 2974515eeeSDan McDonald# CFLAGS for perl, specifically. 301f2ca518SDan McDonaldPCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ 311f2ca518SDan McDonald -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO 32*4c1e9c66SAndrew StormontPCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE64 \ 33*4c1e9c66SAndrew Stormont -DPERL_USE_SAFE_PUTENV -D_TS_ERRNO 3474515eeeSDan McDonald 35*4c1e9c66SAndrew Stormont$(MACH) $(MACH64): 36c9f77c52SAndy Stormont $(INS.dir) 37c9f77c52SAndy Stormont 38c9f77c52SAndy Stormont$(PERLEXT): $(MACH)/$(MODULE).o 39c9f77c52SAndy Stormont $(BUILD.SO) $(MACH)/$(MODULE).o 40c9f77c52SAndy Stormont 41*4c1e9c66SAndrew Stormont$(PERLEXT64): $(MACH64)/$(MODULE).o 42*4c1e9c66SAndrew Stormont $(BUILD64.SO) $(MACH64)/$(MODULE).o 43*4c1e9c66SAndrew Stormont 44c9f77c52SAndy Stormont$(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c 4574515eeeSDan McDonald $(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@ 46c9f77c52SAndy Stormont 47*4c1e9c66SAndrew Stormont$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c 48*4c1e9c66SAndrew Stormont $(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@ 49c9f77c52SAndy Stormont 50*4c1e9c66SAndrew Stormont$(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs 51*4c1e9c66SAndrew Stormont $(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@ 52*4c1e9c66SAndrew Stormont 53*4c1e9c66SAndrew Stormont$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs 54*4c1e9c66SAndrew Stormont $(XSUBPP64) $(XSUBPPFLAGS64) $(MODULE).xs >$@ 55*4c1e9c66SAndrew Stormont 56*4c1e9c66SAndrew Stormont$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64): 57c9f77c52SAndy Stormont $(INS.dir) 58c9f77c52SAndy Stormont 59c9f77c52SAndy Stormont$(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm 60c9f77c52SAndy Stormont $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^ 61c9f77c52SAndy Stormont 62*4c1e9c66SAndrew Stormont$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm 63*4c1e9c66SAndrew Stormont $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^ 64*4c1e9c66SAndrew Stormont 65*4c1e9c66SAndrew Stormont$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64): 66c9f77c52SAndy Stormont $(INS.dir) 67c9f77c52SAndy Stormont 68c9f77c52SAndy Stormont$(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so 69c9f77c52SAndy Stormont $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^ 70*4c1e9c66SAndrew Stormont 71*4c1e9c66SAndrew Stormont$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so 72*4c1e9c66SAndrew Stormont $(RM) $@; $(INS) -s -m $(FILEMODE) -f $^ 73