diff options
author | Ian Lynagh <igloo@earth.li> | 2007-05-31 14:35:05 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-05-31 14:35:05 +0000 |
commit | 430453c5131592b6147a80202dc5f7fbe3f3d5fd (patch) | |
tree | 9c7cdf6b13a8586dfa653bb9ff393da5640d2599 /mk | |
parent | ad9d754d2b18d4dd027884e082c20777a29ef7d4 (diff) | |
download | haskell-430453c5131592b6147a80202dc5f7fbe3f3d5fd.tar.gz |
Rework the build system a bit
Key changes:
* Always build as if BIN_DIST is 1. BIN_DIST is thus removed.
* Libraries are configured with prefix set to $$topdir rather than $(prefix)
Diffstat (limited to 'mk')
-rw-r--r-- | mk/config.mk.in | 1 | ||||
-rw-r--r-- | mk/package.mk | 6 | ||||
-rw-r--r-- | mk/paths.mk | 2 | ||||
-rw-r--r-- | mk/target.mk | 100 |
4 files changed, 3 insertions, 106 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in index 83c188b848..ae89765941 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -786,6 +786,7 @@ LNDIR = $(GHC_LNDIR_DIR)/$(GHC_LNDIR_PGM) RUNTEST = $(GHC_RUNTEST_DIR)/$(GHC_RUNTEST_PGM) GENERATED_FILE = chmod a-w +EXECUTABLE_FILE = chmod +x #----------------------------------------------------------------------------- # Haskell compilers and mkdependHS diff --git a/mk/package.mk b/mk/package.mk index 29fdb99b7b..6c22535dbd 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -22,13 +22,8 @@ PKG_DATADIR = $$topdir else -ifeq "$(BIN_DIST)" "" -PKG_LIBDIR = $(libdir) -PKG_DATADIR = $(datadir) -else PKG_LIBDIR = $$libdir PKG_DATADIR = $$datadir -endif endif # Unix @@ -373,7 +368,6 @@ CLEAN_FILES += $(PACKAGE).haddock $(HC) $(HC_OPTS) -D__HADDOCK__ -E $< -o $@ HTML_INSTALL_DIR = $(datadir)/html/libraries/$(PACKAGE) -# NOT the same as HTML_DIR_INSTALLED when BIN_DIST is on install-docs :: $(HTML_DOC) @$(INSTALL_DIR) $(HTML_INSTALL_DIR) diff --git a/mk/paths.mk b/mk/paths.mk index aff12743bc..4cb2bbf8c8 100644 --- a/mk/paths.mk +++ b/mk/paths.mk @@ -233,7 +233,7 @@ TAGS_C_SRCS=$(C_SRCS) # Specifically glafp-utils/mkdependC/mkdependC.prl and others in driver/ and # possibly others elsewhere in the tree. ToDo: fix this properly. MOSTLY_CLEAN_FILES += $(HS_OBJS) $(C_OBJS) $(HSC_C_OBJS) $(GC_C_OBJS) -CLEAN_FILES += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(SCRIPT_LINK) \ +CLEAN_FILES += $(HS_PROG) $(C_PROG) $(SCRIPT_LINK) \ $(PROG) $(LIBRARY) a.out \ $(DERIVED_HSC_SRCS) \ $(DERIVED_GC_SRCS) \ diff --git a/mk/target.mk b/mk/target.mk index 155e7bd438..6e2f0d6940 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -215,7 +215,6 @@ endif # HS_PROG Haskell program # C_PROG C program # LIBRARY Library -# SCRIPT_PROG Script (e.g. Perl script) # # For details of exactly what rule is generated, see the # relevant section below @@ -483,77 +482,6 @@ DllVersionInfo.$(way_)rc ExeVersionInfo.$(way_)rc: echo " END" >> $@ echo "END" >> $@ -#---------------------------------------- -# Script programs - -ifneq "$(SCRIPT_PROG)" "" - -# To produce a fully functional script, you may -# have to add some configuration variables at the top of -# the script, i.e., the compiler driver needs to know -# the path to various utils in the build tree for instance. -# -# To have the build rule for the script automatically do this -# for you, set the variable SCRIPT_SUBST_VARS to the list of -# variables you need to put in. - -# -# SCRIPT_SUBST creates a string of echo commands that -# will when evaluated append the (perl)variable name and its value -# to the target it is used for, i.e., -# -# A=foo -# B=bar -# SCRIPT_SUBST_VARS = A B -# SCRIPT_SUBST=echo "$""A=\"foo\";" >> $@; echo "$""B=\"bar\";" >> $@ -# -# so if you have a rule like the following -# -# foo: -# @(RM) $@ -# @(TOUCH) $@ -# @eval $(SCRIPT_SUBST) -# -# `make foo' would create a file `foo' containing the following -# -# % cat foo -# $A=foo; -# $B=bar; -# % -# -# ToDo: make this work for shell scripts (drop the initial $). -# -ifeq "$(INTERP)" "$(SHELL)" -SCRIPT_SUBST=$(foreach val,$(SCRIPT_SUBST_VARS),"echo \"$(val)=\\\"$($(val))\\\";\" >> $@;") -else -SCRIPT_SUBST=$(foreach val,$(SCRIPT_SUBST_VARS),"echo \"$$\"\"$(val)=\\\"$($(val))\\\";\" >> $@;") -endif - -all :: $(SCRIPT_PROG) - -$(SCRIPT_PROG) : $(SCRIPT_OBJS) - $(RM) $@ - @echo Creating $@... -ifeq "$(INTERP)" "perl" - echo "#! "$(PERL) > $@ -else -ifneq "$(INTERP)" "" - @echo "#!"$(INTERP) > $@ -else - @touch $@ -endif -endif -ifneq "$(SCRIPT_PREFIX_FILES)" "" - @cat $(SCRIPT_PREFIX_FILES) >> $@ -endif -ifneq "$(SCRIPT_SUBST)" "" - @eval $(SCRIPT_SUBST) -endif - @cat $(SCRIPT_OBJS) >> $@ - @chmod a+x $@ - @echo Done. -endif - # --------------------------------------------------------------------------- # Symbolic links @@ -562,43 +490,17 @@ endif ifneq "$(LINK)" "" -all :: $(LINK) - -CLEAN_FILES += $(LINK) - ifeq "$(LINK_TARGET)" "" -ifneq "$(SCRIPT_PROG)" "" -LINK_TARGET = $(SCRIPT_PROG) -else ifneq "$(HS_PROG)" "" LINK_TARGET = $(HS_PROG) else ifneq "$(C_PROG)" "" LINK_TARGET = $(C_PROG) else -LINK_TARGET = dunno +$(error Cannot deduce LINK_TARGET) endif endif endif -endif - -# -# Don't want to overwrite $(LINK)s that aren't symbolic -# links. Testing for symbolic links is problematic to do in -# a portable fashion using a /bin/sh test, so we simply rely -# on perl. -# -$(LINK) : $(LINK_TARGET) - @if ( $(PERL) -e '$$fn="$(LINK)"; exit ((! -f $$fn || -l $$fn) ? 0 : 1);' ); then \ - echo "Creating a symbolic link from $(LINK_TARGET) to $(LINK)"; \ - $(RM) $(LINK); \ - $(LN_S) $(LINK_TARGET) $(LINK); \ - else \ - echo "Creating a symbolic link from $(LINK_TARGET) to $(LINK) failed: \`$(LINK)' already exists"; \ - echo "Perhaps remove \`$(LINK)' manually?"; \ - exit 1; \ - fi; - # # install links to script drivers. |