makefile-engine: whitespace / comments cleanup. No functional change.

This commit is contained in:
Augustin Cavalier
2015-06-22 13:20:09 -04:00
parent dd9b4a3f10
commit d17092ceb1
+147 -155
View File
@@ -1,10 +1,12 @@
## BeOS and Haiku Generic Makefile Engine v2.5.1 ## Haiku Generic Makefile Engine v2.6 ##
## Does all the hard work for the Generic Makefile
## which simply defines the project parameters
## Supports Generic Makefile v2.0, 2.01, 2.1, 2.2, 2.3, 2.4, 2.5 ## Does all the hard work for the Generic Makefile, which only has to specify
## the project parameters.
# determine wheather running on x86 or ppc ## Supports Generic Makefile v2.6.
## Probably works with Generic Makefile v2.0+, but support is not guaranteed.
# Determine the CPU type
MACHINE=$(shell uname -m) MACHINE=$(shell uname -m)
ifeq ($(MACHINE), BePC) ifeq ($(MACHINE), BePC)
CPU = x86 CPU = x86
@@ -12,7 +14,7 @@ else
CPU = $(MACHINE) CPU = $(MACHINE)
endif endif
# create some default settings # Set up defaults.
ifeq ($(NAME), ) ifeq ($(NAME), )
NAME = NameThisApp NAME = NameThisApp
endif endif
@@ -29,104 +31,95 @@ ifeq ($(DRIVER_PATH), )
DRIVER_PATH = misc DRIVER_PATH = misc
endif endif
# specify the mimeset tool # Set the core tools if they're not already specified.
MIMESET := mimeset MIMESET := mimeset
XRES := xres
RESCOMP := rc
CC := gcc
C++ := g++
# specify the tools for adding and removing resources # Set up CFLAGS.
XRES := xres ifeq ($(strip $(TYPE)), DRIVER)
CFLAGS += -D_KERNEL_MODE=1 -fno-pic
else
CFLAGS +=
endif
# specify the tools for compiling resource definition files # Set up optimization flags.
RESCOMP := rc ifeq ($(strip $(OPTIMIZE)), FULL)
OPTIMIZER = -O3
else
ifeq ($(strip $(OPTIMIZE)), SOME)
OPTIMIZER = -O1
else
ifeq ($(strip $(OPTIMIZE)), NONE)
OPTIMIZER = -O0
else
# OPTIMIZE isn't set, so set it to FULL
OPTIMIZER = -O3
endif
endif
endif
# set the compiler and compiler flags # Set up debug information flags.
CC := gcc ifeq ($(strip $(DEBUGGER)), TRUE)
C++ := g++ DEBUG += -g
OPTIMIZER = -O0
endif
CFLAGS += $(OPTIMIZER) $(DEBUG)
# SETTING: set the CFLAGS for each binary type # Set up the warning flags.
ifeq ($(strip $(TYPE)), DRIVER) ifeq ($(strip $(WARNINGS)), ALL)
CFLAGS += -D_KERNEL_MODE=1 -fno-pic CFLAGS += -Wall -Wno-multichar -Wno-ctor-dtor-privacy
else else
CFLAGS += ifeq ($(strip $(WARNINGS)), NONE)
endif CFLAGS += -w
endif
endif
# SETTING: set the proper optimization level # Set up the linker & linker flags.
ifeq ($(strip $(OPTIMIZE)), FULL)
OPTIMIZER = -O3
else
ifeq ($(strip $(OPTIMIZE)), SOME)
OPTIMIZER = -O1
else
ifeq ($(strip $(OPTIMIZE)), NONE)
OPTIMIZER = -O0
else
# OPTIMIZE not set so set to full
OPTIMIZER = -O3
endif
endif
endif
# SETTING: set proper debugger flags
ifeq ($(strip $(DEBUGGER)), TRUE)
DEBUG += -g
OPTIMIZER = -O0
endif
CFLAGS += $(OPTIMIZER) $(DEBUG)
# SETTING: set warning level
ifeq ($(strip $(WARNINGS)), ALL)
CFLAGS += -Wall -Wno-multichar -Wno-ctor-dtor-privacy
else
ifeq ($(strip $(WARNINGS)), NONE)
CFLAGS += -w
endif
endif
# set the linker and linker flags
ifeq ($(origin LD), default) ifeq ($(origin LD), default)
LD := gcc LD := gcc
endif endif
LDFLAGS += $(DEBUG) LDFLAGS += $(DEBUG)
# SETTING: set linker flags for each binary type # Binary-type-specific linker flags.
ifeq ($(strip $(TYPE)), APP) ifeq ($(strip $(TYPE)), APP)
LDFLAGS += -Xlinker -soname=_APP_ LDFLAGS += -Xlinker -soname=_APP_
else else
ifeq ($(strip $(TYPE)), SHARED) ifeq ($(strip $(TYPE)), SHARED)
LDFLAGS += -shared -Xlinker -soname=$(NAME) LDFLAGS += -shared -Xlinker -soname=$(NAME)
else else
ifeq ($(strip $(TYPE)), DRIVER) ifeq ($(strip $(TYPE)), DRIVER)
LDFLAGS += -nostdlib /boot/system/develop/lib/_KERNEL_ \ LDFLAGS += -nostdlib /boot/system/develop/lib/_KERNEL_ \
/boot/system/develop/lib/haiku_version_glue.o /boot/system/develop/lib/haiku_version_glue.o
endif endif
endif endif
endif endif
# guess compiler version # Get the compiler version.
CC_VER = $(word 1, $(subst -, , $(subst ., , $(shell $(CC) -dumpversion)))) CC_VER = $(word 1, $(subst -, , $(subst ., , $(shell $(CC) -dumpversion))))
# set the directory where object files and binaries will be created # Set the object directory if it isn't already.
OBJ_DIR := objects.$(CPU)-$(CC)$(CC_VER)-$(if $(DEBUGGER),debug,release) OBJ_DIR := objects.$(CPU)-$(CC)$(CC_VER)-$(if $(DEBUGGER),debug,release)
# specify the directory the binary should be created in by default # Output the binary alongside the objects unless another directory is specified.
ifeq ($(TARGET_DIR), ) ifeq ($(TARGET_DIR), )
TARGET_DIR := $(OBJ_DIR) TARGET_DIR := $(OBJ_DIR)
endif endif
# NOTE: make doesn't find the target if its name is enclosed in # NOTE: make doesn't find the target if its name is enclosed in quotes.
# quotation marks
ifeq ($(strip $(TYPE)), STATIC) ifeq ($(strip $(TYPE)), STATIC)
TARGET := $(TARGET_DIR)/$(NAME).a TARGET := $(TARGET_DIR)/$(NAME).a
else else
TARGET := $(TARGET_DIR)/$(NAME) TARGET := $(TARGET_DIR)/$(NAME)
endif endif
# Psuedo-function for converting a list of source files in SRCS variable to a
# psuedo-function for converting a list of source files in SRCS variable # corresponding list of object files in $(OBJ_DIR)/xxx.o. The "function" strips
# to a corresponding list of object files in $(OBJ_DIR)/xxx.o # off the src file suffix (.ccp or .c or whatever) and then strips off the
# The "function" strips off the src file suffix (.ccp or .c or whatever) # off the directory name, leaving just the root file name. It then appends the
# and then strips of the directory name, leaving just the root file name. # .o suffix and prepends the $(OBJ_DIR)/ path
# It then appends the .o suffix and prepends the $(OBJ_DIR)/ path
define SRCS_LIST_TO_OBJS define SRCS_LIST_TO_OBJS
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \
$(basename $(notdir $(file)))))) $(basename $(notdir $(file))))))
@@ -140,14 +133,14 @@ endef
OBJS = $(SRCS_LIST_TO_OBJS) OBJS = $(SRCS_LIST_TO_OBJS)
DEPENDS = $(SRCS_LIST_TO_DEPENDS) DEPENDS = $(SRCS_LIST_TO_DEPENDS)
# create a unique list of paths to our sourcefiles and resources # Create a unique list of paths to our sourcefiles and resources.
SRC_PATHS += $(sort $(foreach file, $(SRCS) $(RSRCS) $(RDEFS), $(dir $(file)))) SRC_PATHS += $(sort $(foreach file, $(SRCS) $(RSRCS) $(RDEFS), $(dir $(file))))
# add source paths to VPATH if not already present # Add source paths to VPATH if not already present.
VPATH := VPATH :=
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
# SETTING: build the local and system include paths, compose C++ libs # Set up the local & system include paths and C++ stdlibs.
ifneq (,$(filter $(CPU),x86 x86_64)) ifneq (,$(filter $(CPU),x86 x86_64))
LOC_INCLUDES = $(foreach path, $(SRC_PATHS) $(LOCAL_INCLUDE_PATHS), $(addprefix -I, $(path))) LOC_INCLUDES = $(foreach path, $(SRC_PATHS) $(LOCAL_INCLUDE_PATHS), $(addprefix -I, $(path)))
ifeq ($(CC_VER), 2) ifeq ($(CC_VER), 2)
@@ -173,125 +166,125 @@ ifeq ($(CPU), ppc)
endif endif
endif endif
# Add the -L prefix to all of the library paths.
# SETTING: add the -L prefix to all library paths to search
LINK_PATHS = $(foreach path, $(SRC_PATHS) $(LIBPATHS), \ LINK_PATHS = $(foreach path, $(SRC_PATHS) $(LIBPATHS), \
$(addprefix -L, $(path))) $(addprefix -L, $(path)))
# SETTING: specify the additional libraries to link against # Handle the additional libraries specified. If the libraries have a .so or
# if the libraries have a .so or .a prefix, or if they are _APP_ or _KERNEL_ # a .a prefix, or if they are _APP_ or _KERNEL_, simply add them to the list.
# simply add them to the list
LINK_LIBS += $(filter %.so %.a _APP_ _KERNEL_, $(LIBS)) LINK_LIBS += $(filter %.so %.a _APP_ _KERNEL_, $(LIBS))
# if the libraries do not have suffixes and are not _APP_ or _KERNEL_ # If the libraries do not have suffixes and are not _APP_ or _KERNEL_,
# prepend -l to each name: be becomes -lbe # prepend -l to each name:(e.g. "be" becomes "-lbe").
LINK_LIBS += $(foreach lib, $(filter-out %.so %.a _APP_ _KERNEL_, $(LIBS)), $(addprefix -l, $(lib))) LINK_LIBS += $(foreach lib, $(filter-out %.so %.a _APP_ _KERNEL_, $(LIBS)), $(addprefix -l, $(lib)))
# add to the linker flags # Add the linkpaths and linklibs to LDFLAGS.
LDFLAGS += $(LINK_PATHS) $(LINK_LIBS) LDFLAGS += $(LINK_PATHS) $(LINK_LIBS)
# SETTING: add the defines to the compiler flags # Add the defines to CFLAGS.
CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define))) CFLAGS += $(foreach define, $(DEFINES), $(addprefix -D, $(define)))
# SETTING: add the additional compiler flags # Add the additional compiler flags to CFLAGS.
CFLAGS += $(COMPILER_FLAGS) CFLAGS += $(COMPILER_FLAGS)
# SETTING: add the additional linker flags # Add the additional linkflags to LDFLAGS
LDFLAGS += $(LINKER_FLAGS) LDFLAGS += $(LINKER_FLAGS)
# SETTING: use the archive tools if building a static library # Use the archiving tools to create an an archive if we're building a static
# otherwise use the linker # library, otherwise use the linker.
ifeq ($(strip $(TYPE)), STATIC) ifeq ($(strip $(TYPE)), STATIC)
BUILD_LINE = ar -cru "$(TARGET)" $(OBJS) BUILD_LINE = ar -cru "$(TARGET)" $(OBJS)
else else
BUILD_LINE = $(LD) -o "$@" $(OBJS) $(LDFLAGS) BUILD_LINE = $(LD) -o "$@" $(OBJS) $(LDFLAGS)
endif endif
# pseudo-function for converting a list of resource definition files in RDEFS # 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 # 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 # The "function" strips off the rdef file suffix (.rdef) and then strips
# of the directory name, leaving just the root file name. # of the directory name, leaving just the root file name. It then appends the
# It then appends the .rsrc suffix and prepends the $(OBJ_DIR)/ path # the .rsrc suffix and prepends the $(OBJ_DIR)/ path.
define RDEFS_LIST_TO_RSRCS define RDEFS_LIST_TO_RSRCS
$(addprefix $(OBJ_DIR)/, $(addsuffix .rsrc, $(foreach file, $(RDEFS), \ $(addprefix $(OBJ_DIR)/, $(addsuffix .rsrc, $(foreach file, $(RDEFS), \
$(basename $(notdir $(file)))))) $(basename $(notdir $(file))))))
endef endef
# create the resource definitions instruction in case RDEFS is not empty # Create the resource definitions instruction in case RDEFS is not empty.
ifeq ($(RDEFS), ) ifeq ($(RDEFS), )
RSRCS += RSRCS +=
else else
RSRCS += $(RDEFS_LIST_TO_RSRCS) RSRCS += $(RDEFS_LIST_TO_RSRCS)
endif endif
# create the resource instruction # Create the resource instruction.
ifeq ($(RSRCS), ) ifeq ($(RSRCS), )
DO_RSRCS := DO_RSRCS :=
else else
DO_RSRCS := $(XRES) -o $(TARGET) $(RSRCS) DO_RSRCS := $(XRES) -o $(TARGET) $(RSRCS)
endif endif
# the directory for internationalization sources (catkeys) # Set the directory for internationalization sources (catkeys) if it isn't
CATKEYS_DIR := locales # already.
CATKEYS_DIR := locales
# the directory for internationalization resource data (catalogs) # Set the directory for internationalization resource data (catalogs) if it
CATALOGS_DIR := $(OBJ_DIR)/$(APP_MIME_SIG) # isn't already.
CATALOGS_DIR := $(OBJ_DIR)/$(APP_MIME_SIG)
# pseudo-function for converting a list of language codes in CATALOGS variable # Pseudo-function for converting a list of language codes in CATALOGS variable
# to a corresponding list of catkeys files in $(CATALOGS_DIR)/xx.catalog # to a corresponding list of catkeys files in $(CATALOGS_DIR)/xx.catalog
# The "function" appends the .catalog suffix and prepends the $(CATALOGS_DIR)/ path # The "function" appends the .catalog suffix and prepends the
# $(CATALOGS_DIR)/ path.
define LOCALES_LIST_TO_CATALOGS define LOCALES_LIST_TO_CATALOGS
$(addprefix $(CATALOGS_DIR)/, $(addsuffix .catalog, $(foreach lang, $(LOCALES), $(lang)))) $(addprefix $(CATALOGS_DIR)/, $(addsuffix .catalog, $(foreach lang, $(LOCALES), $(lang))))
endef endef
CATALOGS = $(LOCALES_LIST_TO_CATALOGS) CATALOGS = $(LOCALES_LIST_TO_CATALOGS)
# define the actual work to be done # Define the actual work to be done.
default: $(TARGET) default: $(TARGET)
$(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS) $(TARGET): $(OBJ_DIR) $(OBJS) $(RSRCS)
$(BUILD_LINE) $(BUILD_LINE)
$(DO_RSRCS) $(DO_RSRCS)
$(MIMESET) -f "$@" $(MIMESET) -f "$@"
# Create OBJ_DIR if it doesn't exist.
# rule to create the object file directory if needed
$(OBJ_DIR):: $(OBJ_DIR)::
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1
# rule to create the localization sources directory if needed # Create the localization sources directory if it doesn't exist.
$(CATKEYS_DIR):: $(CATKEYS_DIR)::
@[ -d $(CATKEYS_DIR) ] || mkdir $(CATKEYS_DIR) > /dev/null 2>&1 @[ -d $(CATKEYS_DIR) ] || mkdir $(CATKEYS_DIR) >/dev/null 2>&1
# rule to create the localization data directory if needed # Create the localization data directory if it doesn't exist.
$(CATALOGS_DIR):: $(OBJ_DIR) $(CATALOGS_DIR):: $(OBJ_DIR)
@[ -d $(CATALOGS_DIR) ] || mkdir $(CATALOGS_DIR) > /dev/null 2>&1 @[ -d $(CATALOGS_DIR) ] || mkdir $(CATALOGS_DIR) >/dev/null 2>&1
# rules to make the dependency files # Rules to create the dependency files.
$(OBJ_DIR)/%.d : %.c $(OBJ_DIR)/%.d : %.c
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .c:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .c:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.cpp $(OBJ_DIR)/%.d : %.cpp
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .cpp:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .cpp:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.cp $(OBJ_DIR)/%.d : %.cp
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .cp:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .cp:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.cc $(OBJ_DIR)/%.d : %.cc
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .cc:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .cc:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.C $(OBJ_DIR)/%.d : %.C
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .C:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .C:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.CC $(OBJ_DIR)/%.d : %.CC
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .CC:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .CC:$(OBJ_DIR)/%n.o -m -f "$@" $<
$(OBJ_DIR)/%.d : %.CPP $(OBJ_DIR)/%.d : %.CPP
[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1; \ [ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) >/dev/null 2>&1; \
mkdepend $(LOC_INCLUDES) -p .CPP:$(OBJ_DIR)/%n.o -m -f "$@" $< mkdepend $(LOC_INCLUDES) -p .CPP:$(OBJ_DIR)/%n.o -m -f "$@" $<
-include $(DEPENDS) -include $(DEPENDS)
# rules to make the object files # Rules to make the object files.
$(OBJ_DIR)/%.o : %.c $(OBJ_DIR)/%.o : %.c
$(CC) -c $< $(INCLUDES) $(CFLAGS) -o "$@" $(CC) -c $< $(INCLUDES) $(CFLAGS) -o "$@"
$(OBJ_DIR)/%.o : %.cpp $(OBJ_DIR)/%.o : %.cpp
@@ -307,31 +300,30 @@ $(OBJ_DIR)/%.o : %.CC
$(OBJ_DIR)/%.o : %.CPP $(OBJ_DIR)/%.o : %.CPP
$(C++) -c $< $(INCLUDES) $(CFLAGS) -o "$@" $(C++) -c $< $(INCLUDES) $(CFLAGS) -o "$@"
# rules to compile resource definition files # Rules to compile the resource definition files.
$(OBJ_DIR)/%.rsrc : %.rdef $(OBJ_DIR)/%.rsrc : %.rdef
cat $< | $(CC) -E $(INCLUDES) $(CFLAGS) - | grep -v '^#' | $(RESCOMP) -I $(dir $<) -o "$@" - cat $< | $(CC) -E $(INCLUDES) $(CFLAGS) - | grep -v '^#' | $(RESCOMP) -I $(dir $<) -o "$@" -
$(OBJ_DIR)/%.rsrc : %.RDEF $(OBJ_DIR)/%.rsrc : %.RDEF
cat $< | $(CC) -E $(INCLUDES) $(CFLAGS) - | grep -v '^#' | $(RESCOMP) -I $(dir $<) -o "$@" - cat $< | $(CC) -E $(INCLUDES) $(CFLAGS) - | grep -v '^#' | $(RESCOMP) -I $(dir $<) -o "$@" -
# rule to compile localization data catalogs # Rule to compile localization data catalogs.
$(CATALOGS_DIR)/%.catalog : $(CATKEYS_DIR)/%.catkeys $(CATALOGS_DIR)/%.catalog : $(CATKEYS_DIR)/%.catkeys
linkcatkeys -o "$@" -s $(APP_MIME_SIG) -l $(notdir $(basename $@)) $< linkcatkeys -o "$@" -s $(APP_MIME_SIG) -l $(notdir $(basename $@)) $<
# rule to preprocess program sources into file ready for collecting catkeys # Rule to preprocess program sources into file ready for collecting catkeys.
$(OBJ_DIR)/$(NAME).pre : $(SRCS) $(OBJ_DIR)/$(NAME).pre : $(SRCS)
-cat $(SRCS) | $(CC) -E -x c++ $(INCLUDES) $(CFLAGS) -DB_COLLECTING_CATKEYS - > $(OBJ_DIR)/$(NAME).pre -cat $(SRCS) | $(CC) -E -x c++ $(INCLUDES) $(CFLAGS) -DB_COLLECTING_CATKEYS - > $(OBJ_DIR)/$(NAME).pre
# rules to collect localization catkeys # Rules to collect localization catkeys.
catkeys : $(CATKEYS_DIR)/en.catkeys catkeys : $(CATKEYS_DIR)/en.catkeys
$(CATKEYS_DIR)/en.catkeys : $(CATKEYS_DIR) $(OBJ_DIR)/$(NAME).pre $(CATKEYS_DIR)/en.catkeys : $(CATKEYS_DIR) $(OBJ_DIR)/$(NAME).pre
collectcatkeys -s $(APP_MIME_SIG) $(OBJ_DIR)/$(NAME).pre -o $(CATKEYS_DIR)/en.catkeys collectcatkeys -s $(APP_MIME_SIG) $(OBJ_DIR)/$(NAME).pre -o $(CATKEYS_DIR)/en.catkeys
# rule to create localization catalogs # Rule to create localization catalogs.
catalogs : $(CATALOGS_DIR) $(CATALOGS) catalogs : $(CATALOGS_DIR) $(CATALOGS)
# rules to handle lex/flex and yacc/bison files # Rules to handle lex/flex and yacc/bison files.
$(OBJ_DIR)/%.o: %.l $(OBJ_DIR)/%.o: %.l
flex $< flex $<
$(CC) -c $(INCLUDES) $(CFLAGS) lex.yy.c -o "$@" $(CC) -c $(INCLUDES) $(CFLAGS) lex.yy.c -o "$@"
@@ -339,18 +331,18 @@ $(OBJ_DIR)/%.o: %.y
bison -d -y $< bison -d -y $<
$(CC) -c $(INCLUDES) $(CFLAGS) y.tab.c -o "$@" $(CC) -c $(INCLUDES) $(CFLAGS) y.tab.c -o "$@"
# empty rule. Things that depend on this rule will always get triggered # Empty rule. (Things that depend on this rule will always get triggered.)
FORCE: FORCE:
# The generic clean command. Delete everything in the object folder. # The generic "clean" command. (Deletes everything in the object folder.)
clean :: FORCE clean :: FORCE
-rm -rf "$(OBJ_DIR)" -rm -rf "$(OBJ_DIR)"
# remove just the application from the object folder # Remove just the application from the object folder.
rmapp :: rmapp ::
-rm -f $(TARGET) -rm -f $(TARGET)
# make it easy to install drivers for testing # Make it easy to install drivers for testing.
USER_BIN_PATH := $(shell finddir B_USER_NONPACKAGED_ADDONS_DIRECTORY)/kernel/drivers/bin USER_BIN_PATH := $(shell finddir B_USER_NONPACKAGED_ADDONS_DIRECTORY)/kernel/drivers/bin
USER_DEV_PATH := $(shell finddir B_USER_NONPACKAGED_ADDONS_DIRECTORY)/kernel/drivers/dev USER_DEV_PATH := $(shell finddir B_USER_NONPACKAGED_ADDONS_DIRECTORY)/kernel/drivers/dev
@@ -369,15 +361,15 @@ else
cp $(TARGET) $(INSTALL_DIR)/$(NAME) cp $(TARGET) $(INSTALL_DIR)/$(NAME)
endif endif
# catalog installation directory # Set the catalog installation directory if it isn't already.
CATALOG_INSTALL_DIR := $(shell finddir B_USER_NONPACKAGED_DATA_DIRECTORY)/locale/catalogs CATALOG_INSTALL_DIR := $(shell finddir B_USER_NONPACKAGED_DATA_DIRECTORY)/locale/catalogs
# rule to install localization resources catalogs # Rule to install localization resources catalogs.
catalogsinstall :: catalogs catalogsinstall :: catalogs
mkdir -p "$(CATALOG_INSTALL_DIR)/$(APP_MIME_SIG)" mkdir -p "$(CATALOG_INSTALL_DIR)/$(APP_MIME_SIG)"
-cp $(CATALOGS_DIR)/*.catalog "$(CATALOG_INSTALL_DIR)/$(APP_MIME_SIG)" -cp $(CATALOGS_DIR)/*.catalog "$(CATALOG_INSTALL_DIR)/$(APP_MIME_SIG)"
# alternative way of storing localization catalogs - bind into program executable's resources # Alternate way of storing localization catalogs: bind them into the program
# executable's resources.
bindcatalogs : bindcatalogs :
for lc in $(LOCALES); do linkcatkeys -o $(TARGET) -s $(APP_MIME_SIG) -tr -l $$lc $(CATKEYS_DIR)/$$lc.catkeys; done for lc in $(LOCALES); do linkcatkeys -o $(TARGET) -s $(APP_MIME_SIG) -tr -l $$lc $(CATKEYS_DIR)/$$lc.catkeys; done