X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Ftarget.mk;h=7522603eb53f0d0697849061c82d1c17838fde0a;hb=aa03891e58b07684a5d3c6d6a8b2bf446ac81b28;hp=9d1683aa37e2c666f94a158ec6040dff7d8d4d30;hpb=4c3a648694de47f7146e12c07b71cb01b02763ec;p=ghc-hetmet.git diff --git a/mk/target.mk b/mk/target.mk index 9d1683a..7522603 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -155,7 +155,7 @@ ifneq "$(MKDEPENDC_SRCS)" "" $(MKDEPENDC) -f .depend $(MKDEPENDC_OPTS) $(foreach way,$(WAYS),-s $(way)) -- $(CC_OPTS) -- $(MKDEPENDC_SRCS) endif ifneq "$(MKDEPENDHS_SRCS)" "" - $(MKDEPENDHS) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(HC_OPTS) $(MKDEPENDHS_SRCS) + $(MKDEPENDHS) -M -optdep-f -optdep.depend $(foreach way,$(WAYS),-optdep-s -optdep$(way)) $(foreach obj,$(MKDEPENDHS_OBJ_SUFFICES),-osuf $(obj)) $(MKDEPENDHS_OPTS) $(filter-out -split-objs, $(HC_OPTS)) $(MKDEPENDHS_SRCS) endif @@ -301,19 +301,8 @@ else $(HS_PROG) :: $(HS_OBJS) $(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS) endif -endif -# Object and interface files have suffixes tagged with their ways -ifneq "$(way)" "" -SRC_HC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(way_)o -endif - -# add syslib dependencies and current package name -SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS)) -ifneq "$(PACKAGE)" "" -SRC_HC_OPTS += -package-name $(PACKAGE) -else -# No library, we are actually building the tools +# for building a Haskell program, we add FptoolsHcOpts SRC_HC_OPTS += $(FptoolsHcOpts) endif @@ -347,13 +336,18 @@ endif ifneq "$(PACKAGE)" "" +# add syslib dependencies and current package name +SRC_HC_OPTS += -package-name $(PACKAGE) +SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS)) + ifeq "$(IS_CBITS_LIB)" "YES" _cbits := _cbits STUBOBJS += $(HSC_C_OBJS) # Add _hsc.c files to the cbits library -SRCS += $(wildcard ../*_hsc.c) +C_SRCS += $(wildcard ../*_hsc.c) # Make .hsc.h include files from the directory above visible -SRC_CC_OPTS += -I.. +# (and the cbits/ library too). +SRC_CC_OPTS += -I.. -I. endif LIBRARY = libHS$(PACKAGE)$(_cbits)$(_way).a @@ -374,7 +368,7 @@ endif SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) ifeq "$(IS_CBITS_LIB)" "YES" -override datadir:=$(libdir)/includes +override datadir:=$(libdir)/include INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(PACKAGE)"').h else SRC_CC_OPTS += -Icbits @@ -385,7 +379,7 @@ endif # PACKAGE #---------------------------------------- # Libraries/archives # -# Build $(LIBRARY) from $(LIBOJBS)+$(STUBOBJS) +# Build $(LIBRARY) from $(LIBOBJS)+$(STUBOBJS) # # Inputs: # $(LIBOBJS) @@ -418,11 +412,22 @@ ifneq "$(way)" "u" SRC_HC_OPTS += -split-objs +ifeq "$(ArSupportsInput)" "" define BUILD_LIB $(RM) $@ (echo $(STUBOBJS); $(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o') | xargs ar q $@ $(RANLIB) $@ endef +else +define BUILD_LIB +$(RM) $@ +echo $(STUBOBJS) > $@.list +$(FIND) $(patsubst %.$(way_)o,%,$(LIBOBJS)) -name '*.$(way_)o' >> $@.list +$(AR) $(AR_OPTS) $@ $(ArSupportsInput) $@.list +$(RM) $@.list +$(RANLIB) $@ +endef +endif # Extra stuff for compiling Haskell files with $(SplitObjs): @@ -976,11 +981,11 @@ install-strip:: @$(MAKE) EXTRA_INSTALL_OPTS='-s' install endif -########################################### +############################################################################## # # Targets: check tags show # -########################################### +############################################################################## #------------------------------------------------------------ # Check @@ -1018,11 +1023,14 @@ endif # show: - @echo '$(VALUE)=$($(VALUE))' + @echo '$(VALUE)="$($(VALUE))"' -#-------------------------------------------------------------------------- -# SGML Documentation +################################################################################ # +# SGML Documentation +# +################################################################################ + .PHONY: dvi ps html pdf rtf ifneq "$(SGML_DOC)" "" @@ -1061,11 +1069,11 @@ extraclean :: $(RM) -rf $(SGML_DOC) endif -########################################### +############################################################################## # # Targets: clean # -########################################### +############################################################################## # we have to be careful about recursion here; since all the clean # targets are recursive, we don't want to make eg. distclean depend on @@ -1090,11 +1098,11 @@ maintainer-clean:: extraclean @echo 'deletes files that may need special tools to rebuild.' rm -f $(MOSTLY_CLEAN_FILES) $(CLEAN_FILES) $(DIST_CLEAN_FILES) $(MAINTAINER_CLEAN_FILES) -################################################################################# +################################################################################ # # Way management # -################################################################################# +################################################################################ # Here is the ingenious jiggery pokery that allows you to build multiple versions # of a program in a single build tree. @@ -1149,6 +1157,16 @@ $(LIB_WAY_TARGETS) : endif # if way +# ------------------------------------------------------------------------- +# Object and interface files have suffixes tagged with their ways + +ifneq "$(way)" "" +SRC_HC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(way_)o +endif + +# ------------------------------------------------------------------------- +# Rules to invoke the current target recursively for each way + ifneq "$(WAYS)" "" ifeq "$(way)" ""