diff --git a/data/develop/makefile b/data/develop/makefile index 8e86110d36..30f3438386 100644 --- a/data/develop/makefile +++ b/data/develop/makefile @@ -32,8 +32,13 @@ TYPE= # in folder names do not work well with this makefile. SRCS= -# specify the resource files to use +# specify the resource definition files to use # full path or a relative path to the resource file can be used. +RDEFS= + +# specify the resource files to use. +# full path or a relative path to the resource file can be used. +# both RDEFS and RSRCS can be defined in the same makefile. RSRCS= # @<-src@ diff --git a/data/develop/makefile-engine b/data/develop/makefile-engine index cf89065f9c..a8798a30dd 100644 --- a/data/develop/makefile-engine +++ b/data/develop/makefile-engine @@ -40,6 +40,8 @@ endif # specify the tools for adding and removing resources XRES = xres +# specify the tools for compiling resource definition files + RESCOMP = rc # platform specific settings @@ -267,6 +269,23 @@ else BUILD_LINE = $(LD) -o $@ $(OBJS) $(LDFLAGS) endif +# pseudo-function for converting a list of resource definition files in RDEFS +# variable to a corresponding list of object files in $(OBJ_DIR)/xxx.rsrc +# The "function" strips off the rdef file suffix (.rdef) and then strips +# of the directory name, leaving just the root file name. +# It then appends the .rsrc suffix and prepends the $(OBJ_DIR)/ path +define RDEFS_LIST_TO_RSRCS + $(addprefix $(OBJ_DIR)/, $(addsuffix .rsrc, $(foreach file, $(RDEFS), \ + $(basename $(notdir $(file)))))) +endef + +# create the resource definitions instruction in case RDEFS is not empty + ifeq ($(RDEFS), ) + RSRCS += + else + RSRCS += $(RDEFS_LIST_TO_RSRCS) + endif + # create the resource instruction ifeq ($(RSRCS), ) DO_RSRCS := @@ -329,6 +348,12 @@ $(OBJ_DIR)/%.o : %.CC $(OBJ_DIR)/%.o : %.CPP $(CC) -c $< $(INCLUDES) $(CFLAGS) -o $@ +# rules to compile resource definition files +$(OBJ_DIR)/%.rsrc : %.rdef + $(RESCOMP) -o $@ $< +$(OBJ_DIR)/%.rsrc : %.RDEF + $(RESCOMP) -o $@ $< + # rules to handle lex/flex and yacc/bison files $(OBJ_DIR)/%.o: %.l