X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fwebcc.git;a=blobdiff_plain;f=src%2FMakefile;h=b4c8225f63ee3947010f64490400292d4c1b21a1;hp=89ebf6e9b33a0c2d6c4c5713d73cab8b3a9b9f2b;hb=522656e8b68f7189d1c221e19211946ba7774ab5;hpb=92d574d704e54743631464fac3ce739b1077222c diff --git a/src/Makefile b/src/Makefile index 89ebf6e..b4c8225 100644 --- a/src/Makefile +++ b/src/Makefile @@ -144,7 +144,7 @@ $(eval OLDER_TIME := $(firstword $(sort $(NEWEST_TRG_TIME) $(SRC_TIME)))) $(if $(MAKECMDGOALS), $(eval BUILDGOALS := $(filter-out clean scrub purge uninstall,$(MAKECMDGOALS))), $(eval BUILDGOALS := all)) -$(if $(or $(MISSING_TRG), $(and $(BUILDGOALS),$(filter $(OLDER_TIME),$(NEWEST_TRG_TIME)))), +$(if $(and $(BUILDGOALS),$(or $(MISSING_TRG), $(filter $(OLDER_TIME),$(NEWEST_TRG_TIME)))), $(if $(findstring n,$(MAKEFLAGS)), $(SLANG_TRG): $(SHELL_CMD) @@ -242,7 +242,9 @@ $(eval DRIVER_MODULES := $(filter-out $(DRIVER_DIR) ..,$(sort $(DRIVER_MODULES)) # any internal modules, the developer may instead create a file with the same # basename as the driver, but with the '.ld' suffix, which contains a space # separated list of internal modules to link together during compilation -$(eval DRIVER_MODULES += $(file <$(1:%.$2=%.ld))) +$(eval DRIVER_LDVALS := $(file <$(1:%.$2=%.ld))) +$(eval DRIVER_LFLAGS := $(filter -l%,$(DRIVER_LDVALS))) +$(eval DRIVER_MODULES += $(filter-out -l%,$(DRIVER_LDVALS))) # List of module archives to link together during compilation $(eval DRIVER_ARCHIVES := $(DRIVER_MODULES:%=%.$($2_AROBJ))) @@ -271,8 +273,8 @@ $(if $($2_DBG),$(eval MAKE_DIRS += $(DRIVER_TARG_DIR).$($2_DBG))) # '_start'). This driver object is then simply linked to its libraries and # module archives to create an executable binary in the output folder. # ORDER MATTERS HERE, this is for the linker: -$(eval DRIVER_SRC := $(DRIVER_DEPS)) -$(eval DRIVER_DBGSRC := $(DRIVER_DBGDEPS)) +$(eval DRIVER_SRC := $(DRIVER_LFLAGS) $(DRIVER_DEPS)) +$(eval DRIVER_DBGSRC := $(DRIVER_LFLAGS) $(DRIVER_DBGDEPS)) # Iterate through the list of libraries in our language and stack commands from # left to right in the "sources" section of the LD command (or LD section of the # commandline for the compiler), to preserve ordering and also ensure that it is