1##--------------------------------------------------------------------------
2# Makefile for perl
3##--------------------------------------------------------------------------
4# Wilfredo Sanchez | wsanchez@apple.com
5# I wish they'd just use autoconf. This is hairy.
6# Modified by Edward Moy <emoy@apple.com>
7##--------------------------------------------------------------------------
8
9# Project info
10Project             = perl
11UserType            = Developer
12ToolType            = Commands
13##--------------------------------------------------------------------------
14# env_no_rc_trace is a shell script that removes RC_TRACE_ARCHIVES and
15# RC_TRACE_DYLIBS from the environment before exec-ing the argument.
16# This is necessary because otherwise B&I logging messages will get into
17# the cppsymbols value in Config.pm and break h2ph (3093501).
18##--------------------------------------------------------------------------
19Configure           = '$(TOPSRCROOT)/env_no_rc_trace' '$(BuildDirectory)'/Configure
20Extra_Environment   = HTMLDIR='$(Install_HTML)' AR='$(TOPSRCROOT)/fix/ar.sh'
21Extra_Install_Flags = HTMLDIR='$(RC_Install_HTML)' HTMLROOT='$(Install_HTML)'
22GnuAfterInstall     = zap-sitedirs make-extra-links
23ifeq "$(RC_XBS)" "YES"
24GnuNoBuild	    = YES
25endif
26
27# It's a GNU Source project
28# Well, not really but we can make it work.
29include $(MAKEFILEPATH)/CoreOS/ReleaseControl/GNUSource.make
30
31# Override compiler setting from GNUSource.make to use those set in GNUmakefile
32override CC = $(MY_CC)
33
34Install_Target  = install
35CC_Optimize     = 
36Configure_Flags = -ds -e -Dprefix='$(Install_Prefix)' -Dccflags='$(CFLAGS)' -Dldflags='$(LDFLAGS)' -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=$(MY_CC)
37
38##---------------------------------------------------------------------
39# Patch config.h, Makefile and others just after running configure
40##---------------------------------------------------------------------
41ConfigStamp2 = $(ConfigStamp)2
42
43configure:: $(ConfigStamp2)
44
45$(ConfigStamp2): $(ConfigStamp)
46	$(MAKE) -f Makefile patchconfig
47	$(_v) $(TOUCH) $(ConfigStamp2)
48
49patchconfig::
50	$(_v) sed -e 's/@PREPENDFILE@/$(PREPENDFILE)/g' \
51	    -e 's/@APPENDFILE@/$(APPENDFILE)/g' \
52	    -e 's/@NONLP@/$(NONLP)/g' \
53	    -e 's,@UPDATESLIB@,$(UPDATESLIB),g' \
54	    -e 's/@VERSION@/$(ENV_PERL_BASE_VERSION)/g' \
55	    '$(SRCROOT)/fix/config.h.ed' \
56	| ed - '${BuildDirectory}/config.h'
57	$(_v) ed - '${BuildDirectory}/Makefile' < '$(SRCROOT)/fix/Makefile.ed'
58	$(_v) ed - '${BuildDirectory}/cflags' < '$(SRCROOT)/fix/cflags.ed'
59	$(_v) sed 's/@VERSION@/$(ENV_PERL_BASE_VERSION)/g' $(SRCROOT)/fix/perlmain.c.ed | ed - ${BuildDirectory}/miniperlmain.c
60
61zap-sitedirs:
62	$(_v) $(RMDIR) '$(DSTROOT)$(NSLOCALDIR)$(NSLIBRARYSUBDIR)'
63
64make-extra-links:
65	$(_v) $(LN) '$(DSTROOT)/usr/share/man/man1/perl.1' '$(DSTROOT)/usr/share/man/man1/perl$(ENV_PERL_BASE_VERSION).1'
66	$(_v) $(LN) '$(DSTROOT)/usr/share/man/man1/perl.1' '$(DSTROOT)/usr/share/man/man1/perl$(ENV_PERL_VERSION).1'
67
68Makefile_inc := $(TOPSRCROOT)/Platforms/$(RC_TARGET_CONFIG)/$(ENV_PERL_BASE_VERSION)/Makefile.inc
69ifneq ($(wildcard $(Makefile_inc)),)
70include $(Makefile_inc)
71endif
72