X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Ftarget.mk;h=fd0502b67a0363dd5a61f5bb02304978e051b14b;hb=033561ea87f90b8de024f0a82b13c7327e2c6117;hp=69f48c8ada3638768228d7eec542e6da75a61c06;hpb=7d74fdf5eb88dda397430f238870d1c3a628d0b8;p=ghc-hetmet.git diff --git a/mk/target.mk b/mk/target.mk index 69f48c8..fd0502b 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -79,10 +79,24 @@ ifneq "$(SUBDIRS)" "" -# we override the boot & all targets in the top level Makefile -ifneq "$(NO_ALL_TARGETS)" "YES" +# we override the 'boot', 'all' and 'install' targets in the top +# level Makefile. Some of the sub-projects also set 'boot' to empty. + +ifeq "$(NO_ALL_TARGET)" "YES" +ALL_TARGET = +else ALL_TARGET = all +endif + +ifeq "$(NO_BOOT_TARGET)" "YES" +BOOT_TARGET = +else BOOT_TARGET = boot +endif + +ifeq "$(NO_INSTALL_TARGET)" "YES" +INSTALL_TARGET = +else INSTALL_TARGET = install endif @@ -165,8 +179,12 @@ endif # The boot target, at a minimum generates dependency information .PHONY: boot -boot :: depend +ifeq "$(NO_BOOT_TARGET)" "YES" +boot :: +else +boot :: depend +endif ################################################################## # GNU Standard targets @@ -297,7 +315,7 @@ ifneq "$(BootingFromHc)" "YES" $(HS_PROG) :: $(HS_OBJS) $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS) else -# see bootstrp.mk +# see bootstrap.mk $(HS_PROG) :: $(HS_OBJS) $(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS) endif @@ -344,13 +362,18 @@ 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 +ifneq "$(way)" "i" LIBRARY = libHS$(PACKAGE)$(_cbits)$(_way).a GHCI_LIBRARY = HS$(PACKAGE)$(_cbits)$(_way).o +else +LIBRARY = $(PACKAGE).dll +endif ifneq "$(IS_CBITS_LIB)" "YES" WAYS=$(GhcLibWays) @@ -364,8 +387,6 @@ ifeq "$(LIBOBJS)" "" endif endif -SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) - ifeq "$(IS_CBITS_LIB)" "YES" override datadir:=$(libdir)/include INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(PACKAGE)"').h @@ -378,7 +399,7 @@ endif # PACKAGE #---------------------------------------- # Libraries/archives # -# Build $(LIBRARY) from $(LIBOJBS)+$(STUBOBJS) +# Build $(LIBRARY) from $(LIBOBJS)+$(STUBOBJS) # # Inputs: # $(LIBOBJS) @@ -390,11 +411,18 @@ endif # PACKAGE ifneq "$(LIBRARY)" "" all :: $(LIBRARY) +ifneq "$(way)" "i" define BUILD_LIB $(RM) $@ $(AR) $(AR_OPTS) $@ $(STUBOBJS) $(LIBOBJS) $(RANLIB) $@ endef +else +define BUILD_LIB +$(RM) $@ +al -out:$@ $(STUBOBJS) $(LIBOBJS) +endef +endif # # For Haskell object files, we might have chosen to split @@ -434,7 +462,7 @@ HC_SPLIT_PRE = \ $(RM) $@; if [ ! -d $(basename $@) ]; then mkdir $(basename $@); else \ $(FIND) $(basename $@) -name '*.$(way_)o' | xargs $(RM) __rm_food; fi ifeq "$(GhcWithInterpreter)" "YES" -HC_SPLIT_POST = ld -r -x -o $@ $(basename $@)/*.$(way_)o +HC_SPLIT_POST = $(LD) -r -x -o $@ $(basename $@)/*.$(way_)o else HC_SPLIT_POST = touch $@ endif # GhcWithInterpreter == YES @@ -464,12 +492,12 @@ ifeq "$(StripLibraries)" "YES" ifeq "$(SplitObjs)" "YES" SRC_HC_POST_OPTS += \ for i in $(basename $@)/*; do \ - ld -r -x -o $$i.tmp $$i; \ + $(LD) -r -x -o $$i.tmp $$i; \ $(MV) $$i.tmp $$i; \ done else SRC_HC_POST_OPTS += \ - ld -r -x -o $@.tmp $@; $(MV) $@.tmp $@ + $(LD) -r -x -o $@.tmp $@; $(MV) $@.tmp $@ endif # SplitObjs endif # StripLibraries @@ -505,21 +533,18 @@ CLEAN_FILES += $(GHCI_LIBRARY) all :: $(GHCI_LIBRARY) -ifneq "$(GHCI_LIBRARY)" "HSstd.o" -# An annoying gotcha is that the Prelude is a bit special, -# for reasons described in ghc/lib/std/Makefile. -# So we only put in this standard rule for packages other than std -# The rule for the Prelude is in ghc/lib/std/Makefile -# We check for GHCI_LIBRARY being HSstd.o rather than -# PACKAGE being std, because we want to still use the boilerplate rule -# for cbits. +ifneq "$(DONT_WANT_STD_GHCI_LIB_RULE)" "YES" +# If you don't want to build GHCI_LIBRARY the 'standard' way, +# set DONT_WANT_STD_GHCI_LIB_RULE to YES. The Prelude and +# hslibs/Win32 uses this 'feature'. +# $(GHCI_LIBRARY) :: $(LIBOBJS) - ld -r -x -o $@ $(LIBOBJS) $(STUBOBJS) -endif + $(LD) -r -x -o $@ $(LIBOBJS) $(STUBOBJS) +endif # DONT_WANT_STD_GHCI_LIB_RULE endif # GhcWithInterpreter endif # way -endif # GHCI_LIBRARY +endif # GHCI_LIBRARY != "" #----------------------------------------