X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rules%2Fbuild-perl.mk;h=c232193478add7088ee0a2d6c57b49e77263ffc5;hb=a3be88fd60cc63b97ec8509f46a8d93025760792;hp=982a2b699df39b8b1999f908b3d2091e24e4ed9b;hpb=fae43d78c5f7fdcdd236e187d07d140b9ad4e07c;p=ghc-hetmet.git diff --git a/rules/build-perl.mk b/rules/build-perl.mk index 982a2b6..c232193 100644 --- a/rules/build-perl.mk +++ b/rules/build-perl.mk @@ -19,16 +19,19 @@ # $(eval $(call build-perl,driver/mangler,dist)) define build-perl +$(call trace, build-perl($1,$2)) # $1 = dir # $2 = distdir -ifeq "$$($1_$2_LIBEXEC)" "YES" -$1_$2_INPLACE = $(INPLACE_LIB)/$$($1_$2_PROG) +ifeq "$$($1_$2_TOPDIR)" "YES" +$1_$2_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG) else -$1_$2_INPLACE = $(INPLACE_BIN)/$$($1_$2_PROG) +$1_$2_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG) endif -$(call all-target,$$($1_$2_INPLACE)) +ifeq "$$(phase_1_or_later)" "YES" +$(call all-target,$1_$2,$$($1_$2_INPLACE)) +endif $(call clean-target,$1,$2,$1/$2 $$($1_$2_INPLACE)) .PHONY: clean_$1 @@ -37,21 +40,30 @@ clean_$1 : clean_$1_$2 # INPLACE_BIN etc. might be empty if we're cleaning ifeq "$(findstring clean,$(MAKECMDGOALS))" "" ifneq "$$(BINDIST)" "YES" -$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) - "$$(MKDIRHIER)" $1/$2 +$1/$2/$$($1_$2_PROG).prl: $1/$$($1_PERL_SRC) $$(UNLIT) | $$$$(dir $$$$@)/. "$$(UNLIT)" $$(UNLIT_OPTS) $$< $$@ +endif $1/$2/$$($1_$2_PROG): $1/$2/$$($1_$2_PROG).prl "$$(RM)" $$(RM_OPTS) $$@ echo '#!$$(PERL)' >> $$@ echo '$$$$TARGETPLATFORM = "$$(TARGETPLATFORM)";' >> $$@ + echo '$$$$TABLES_NEXT_TO_CODE = "$(GhcEnableTablesNextToCode)";' >> $$@ cat $$< >> $$@ - $$(EXECUTABLE_FILE) $$@ -$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) - "$$(MKDIRHIER)" $$(dir $$@) +$$($1_$2_INPLACE): $1/$2/$$($1_$2_PROG) | $$$$(dir $$$$@)/. "$$(CP)" $$< $$@ $$(EXECUTABLE_FILE) $$@ + +ifneq "$$($1_$2_INSTALL_IN)" "" +BINDIST_PERL_SOURCES += $1/$2/$$($1_$2_PROG).prl + +install: install_$1_$2 + +.PHONY: install_$1_$2 +install_$1_$2: $1/$2/$$($1_$2_PROG) + $$(call INSTALL_DIR,"$$($1_$2_INSTALL_IN)") + $$(call INSTALL_SCRIPT,$$(INSTALL_OPTS),$$<,"$$($1_$2_INSTALL_IN)") endif endif