X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Ftarget.mk;h=64cf1c9fda9867385fb0d0cd0aa5025c2941d59c;hb=197a5ee77b09028ce768a8c3d1eb42fda670e161;hp=b6060caf127984a499a798cce3ea871153e13015;hpb=c5e33ef8b437e79e9c22991dcab9ea73482f6909;p=ghc-hetmet.git diff --git a/mk/target.mk b/mk/target.mk index b6060ca..64cf1c9 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -293,8 +293,14 @@ boot :: depend ifneq "$(HS_PROG)" "" all :: $(HS_PROG) +ifneq "$(BootingFromHc)" "YES" $(HS_PROG) :: $(HS_OBJS) - $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS) $(LIBS) + $(HC) -o $@ $(HC_OPTS) $(LD_OPTS) $(HS_OBJS) +else +# see bootstrp.mk +$(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 @@ -308,39 +314,45 @@ endif ifneq "$(C_PROG)" "" all :: $(C_PROG) -ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32" -CC_OPTS += -mno-cygwin -endif - $(C_PROG) :: $(C_OBJS) $(CC) -o $@ $(CC_OPTS) $(LD_OPTS) $(C_OBJS) $(LIBS) endif #---------------------------------------- -# Libraries/archives +# Building HsLibs libraries. + +ifneq "$(HSLIB)" "" ifeq "$(IS_CBITS_LIB)" "YES" _cbits := _cbits endif -ifneq "$(HSLIB)" "" LIBRARY = libHS$(HSLIB)$(_cbits)$(_way).a GHCI_LIBRARY = HS$(HSLIB)$(_cbits)$(_way).o + +ifneq "$(IS_CBITS_LIB)" "YES" +WAYS=$(GhcLibWays) +endif + ifeq "$(LIBOBJS)" "" - ifneq "$(IS_CBITS_LIB)" "YES" - LIBOBJS = $(HS_OBJS) - else + ifeq "$(IS_CBITS_LIB)" "YES" LIBOBJS = $(C_OBJS) + else + LIBOBJS = $(HS_OBJS) endif endif -ifneq "$(IS_CBITS_LIB)" "" -CC = $(HC) + +ifeq "$(IS_CBITS_LIB)" "YES" override datadir:=$(libdir)/includes INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(HSLIB)"').h SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR) endif -endif + +endif # HSLIB + +#---------------------------------------- +# Libraries/archives ifneq "$(LIBRARY)" "" all :: $(LIBRARY)