* Applied patch by Siarzhuk Zharski that adds support for .rdef files to the
makefile-engine. Thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30771 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d88527df5c
commit
314854708a
@ -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@
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user