X-Git-Url: https://www.kengrimes.com/gitweb/?a=blobdiff_plain;f=src%2FMakefile;h=06466c6d741ee32881432c55e59f25d4838a7234;hb=63a45325961d5117557022469db102efaed6d378;hp=89ebf6e9b33a0c2d6c4c5713d73cab8b3a9b9f2b;hpb=657378005efb48ea3f036633165bdcf53c902c70;p=henge%2Fwebcc.git diff --git a/src/Makefile b/src/Makefile index 89ebf6e..06466c6 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 @@ -472,7 +474,7 @@ $(eval $1_OBJ := $($($1_C)_OBJ) $1_OUT := $($($1_C)_OUT) $1_AROBJ := $($($1_C)_AROBJ) -$1_SOURCES := $(subst ./,,$(shell find -name "*.$1")) +$1_SOURCES := $(subst ./,,$(shell find -name "*.$1" -not -name ".*")) $1_DBG := $($($1_C)_DBG) $1_AR := $($($1_C)_AR) )