📄 rules.windml
字号:
# rules.windml - Host independent rules for making WindML libraries## modification history# --------------------# 01g,18jun03,jlb Update to Tornado 2.2# 01f,20jul01,gav SPR 69179. Restored optimizations for SH.# 01g,20jun01,sts Sort out the providers of posix threads# 01g,18jun01,c_s Add Native support# 01f,15jun01,c_s Remove vx suffix from LIBDIR* in non-VxWorks environments# 01e,19oct00,jlb For SH7750, turn off optimizations# 01d,17oct00,jlb Added help message# 01c,16oct00,jlb Remove ugl archive builds from examples (SPR 35102)# Fix create ugl object directory (SPR 34938)# 01b,29sep00,jlb Added builds from config tool# 01a,31jul00,jlb created### DESCRIPTION## This file is included by every Makefile in the WindML build.# This file contains makefile rules that are host independent for creating# windML libraries. ## INCLUDES# include $(WINDML_CONFIG_DIR)/$(WINDML_CONFIG_NAME)_makefile# include $(TGT_DIR)/h/make/defs.default# include $(TGT_DIR)/h/make/make.$(CPU)$(TOOL)# include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)## The build targets supported for maintaining the WindML are:## targets for maintaining the ugl archive.## ugl (default)- # Compiles each modified file and updates the ugl archive with # with the new object files## uglrclean/rclean - # Recursively removes each object file and deletes the archive. # ## uglclean/clean - # Removes each object file in the current directory#### Build targets for maintaining the WindML demonstration programs## ugldemo - # Compiles each modified demo program creating a demo.o and a# demo_ugl.o object file where the demo_ugl.o file also contains# the WindML components## ugldemoclean - # Removes all the demonstration program object files## ################################################################################ Include some default definitions#include $(TGT_DIR)/h/make/defs.default############################################################### Main build target when building the examples directory##ifeq ($(BLD_TYPE),UGL_DEMO)ifeq ($(UGL_DEMO_LIST),)build_demo: ugldemoendifendifDefault: checkdir lib subdirs## re-map TOOL_FAMILY to TOOLifeq ($(TOOL_FAMILY),gnu)ifeq ($(findstring diab,$(TOOL)),diab)TOOL_FAMILY = diabendifendifinclude $(TGT_DIR)/h/tool/$(TOOL_FAMILY)/make.$(CPU)$(TOOL)LIB_ROOT = $(TGT_DIR)$(DIRCHAR)lib$(DIRCHAR)$(TOOLENV)$(DIRCHAR)$(CPU)$(DIRCHAR)$(TOOL_COMMON_DIR)LIB_PATH = $(TOOLENV)$(DIRCHAR)$(CPU)$(DIRCHAR)$(TOOL_COMMON_DIR)## Ignore errors deailing with illegal lvalueifeq ($(TOOL_FAMILY),diab)COMMON_COMPILER += -ei1549 -Xvoid-ptr-arith-ok endif# Include host definitions#include $(TGT_DIR)/h/make/defs.$(WIND_HOST_TYPE)## If RMDIR is not defined (pre VxWorks 5.5), define itifeq ($(RMDIR),)ifeq ($(WIND_HOST_TYPE),x86-win32)RMDIR = rd /S /QelseRMDIR = rm -f -rendifendif# Define the WindML archive based on teh VxWoirks versionLIBBASENAME = wndmlLIBNAME = $(LIB_PATH)$(DIRCHAR)lib$(LIBBASENAME).aLIBDIRNAME = obj$(LIBBASENAME)LIBNAME_DIR = $(LIB_ROOT)$(DIRCHAR)lib$(LIBBASENAME).aLIBDIR = $(LIB_ROOT)$(DIRCHAR)$(LIBDIRNAME)OBJBASENAME = $(LIBBASENAME)# Specify the directory name for the example programs. This is where# the compiled objects for the examples are placedifeq ($(BLD_TYPE),UGL_DEMO)LIBDIR = $(TGT_DIR)/lib/obj$(CPU)$(TOOL)Appsendif############################################################### Define the implicit rules.c.o : @ $(RM) $@ $(CC) $(CFLAGS) $(OPTION_OBJECT_ONLY) $<# rules to build objects in $(LIBDIR)$(LIBDIR)/%.o : %.c @ $(RM) $(subst /,$(DIRCHAR),$@) $(CC) $(CFLAGS) $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $<# rules to construct object lists# get the list of .c, .cpp and .s filesFILE_LIST = $(wildcard *.[cs]) $(INDIRECT_SOURCES)# Change .c to .o in FILE_LIST and store in OBJ_PRESENT. These # are the objects we can buildOBJ_PRESENT = $(FILE_LIST:.c=.o)# Find the intersection of the objects we can build and the objects we'd# like to buildOBJS_TO_BUILD = $(filter $(OBJ_PRESENT),$(OBJS))#Now we fix up where they will go once they are builtLIBOBJS = $(foreach file, $(OBJS_TO_BUILD), $(LIBDIR)/$(file))# It is safe to assume that if a subdirectory exists with a Makefile in it # that we want to build it. If this is not the case one needs to over ride # this definition in the Makefile for the directory in concern. ifeq ($(SUBDIRS),)SUBDIRS = $(patsubst %/,%,$(dir $(wildcard */Makefile)))endif# recursive clean rulerclean: ifneq ($(SUBDIRS),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) \ TARGET=rclean $(SUBDIRS)endififeq ($(BUILD_FROM_ROOT),yes) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) dependcleanelse $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) cleanendif## Remove the depend filesdependclean:ifeq ($(WIND_HOST_TYPE),x86-win32) @if exist depend.$(CPU)$(TOOL) $(RM) depend.$(CPU)$(TOOL)else @ - if [ -f depend.$(CPU)$(TOOL) ] ; then \ $(RM) depend.$(CPU)$(TOOL) ; \ fiendif # recursive build of all object#all-objs : objsifneq ($(SUBDIRS),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) \ TARGET=al-objs $(SUBDIRS)endif# Just in case you want to build objects and not update the archivesobjs: $(LIBOBJS)release: $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) \ TARGET=release# Get rules specific to building based on the host#include $(TGT_DIR)/h/make/rules-lib.$(WIND_HOST_TYPE)# we don't need a dependency list if are not building objectsifneq ($(OBJS),)# for WindML, we delete the entire archive for an rcleanifneq ($(TARGET),rclean)# We suppress the warning message about non existent file and setting of errno# by prepending - . GNU make allows this.-include depend.$(CPU)$(TOOL)endifendif# Determine build targets from the configuration toolBLD_UGLA = uglBLD_UGLO = $(filter $(BLD_MODE),uglobj)BLD_UGLE = $(filter $(BLD_MODE),ugldemo)CLEAN_UGLA = $(filter $(CLEAN_MODE),uglrclean)CLEAN_UGLO = $(filter $(CLEAN_MODE),uglobjclean)CLEAN_UGLE = $(filter $(CLEAN_MODE),ugldemorclean)ifneq ($(BLD_TYPE),UGL_DEMO)############################################################## Update the WindML archive#ugl: checkdir $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) BLD_TYPE=UGL # Recursively remove each object file and the archiveuglrclean: checkdir rclean $(RM) $(LIBNAME_DIR) $(RMDIR) $(LIBDIR)# Remove the object file in the current directoryuglclean: checkdir cleanendif###################################################### Build the UGL example programs## Do not archive the demo filesifeq ($(BLD_TYPE),UGL_DEMO)AR = $(ECHO)RANLIB = $(ECHO)endif# Example programs object locations and namesifeq ($(BLD_TYPE),UGL_DEMO)ifeq ($(UGL_DEMO_LIST),)NUM_DEMO_OBJS = $(words $(OBJS))ifeq ($(UGL_APP_NAME),)UGL_APP_NAME = $(OBJS)endifendifendifUGL_DEMO_DIR = $(LIBDIR)/UGL_APP_OBJ = $(UGL_DEMO_DIR)$(UGL_APP_NAME)UGL_APP_BASE = $(basename $(UGL_APP_NAME))UGL_APP_UGL_OBJ = $(UGL_DEMO_DIR)$(UGL_APP_BASE)_ugl.o# Build the demo.o and the demo_ugl.o object filesugldemo: checkdirifneq ($(UGL_APP_LAYER),)ifeq ($(BLD_UGLA),)ifeq ($(BLD_UGLO),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) BLD_TYPE=UGLendifendif $(MAKE) -C example CPU=$(CPU) TOOL=$(TOOL) BLD_TYPE=UGL_DEMO ugldemoendififneq ($(UGL_DEMO_LIST),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) BLD_TYPE=UGL_DEMO TARGET=ugldemoendififeq ($(SUBDIRS),) @$(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) BLD_TYPE=UGL_DEMO demo_sa @$(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) BLD_TYPE=UGL_DEMO demo_uglendif# create an application not linked to any librariesdemo_sa: $(UGL_APP_OBJ)ifeq ($(LD_PARTIAL_FLAGS),)LD_PARTIAL_FLAGS = -rendififneq ($(NUM_DEMO_OBJS),1)$(UGL_APP_OBJ): $(LIBOBJS) $(LD) $(LD_PARTIAL_FLAGS) -o $@ $^ endif# *_ugl links the ugl library in to the applicationdemo_ugl: $(UGL_APP_UGL_OBJ)$(UGL_APP_UGL_OBJ): $(UGL_APP_OBJ) $(LIBNAME_DIR) $(LD) $(LD_PARTIAL_FLAGS) -o $@ $^############################################################### Remove the WindML demonstration program object files## Handle the recursive cleanugldemorclean:ifneq ($(UGL_APP_LAYER),) $(MAKE) -C example CPU=$(CPU) TOOL=$(TOOL) BLD_TYPE=UGL_DEMO ugldemorcleanendififneq ($(UGL_DEMO_LIST),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) BLD_TYPE=UGL_DEMO TARGET=ugldemorclean $(SUBDIRS)endififeq ($(SUBDIRS),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) ugldemocleanendif# clean object files for specific demonstration programugldemoclean:ifneq ($(UGL_APP_NAME),) $(MAKE) CPU=$(CPU) TOOL=$(TOOL) TGT_DIR=$(TGT_DIR) clean $(RM) $(UGL_APP_UGL_OBJ) $(RM) $(UGL_APP_OBJ)else $(MAKE) CPU=$(CPU) TOOL=$(TOOL) ugldemorcleanendif############################################################### Verify that the uglConfig.h file is present and if not then create from# the template. File is created by the config tool.#configh: $(TGT_DIR)/h/ugl/config/uglConfig.h $(TGT_DIR)/h/ugl/config/uglConfig.h: $(CP) $(TGT_DIR)$(DIRCHAR)h$(DIRCHAR)ugl$(DIRCHAR)config$(DIRCHAR)uglConfigTemplate.h $(subst /,$(DIRCHAR),$@)ifneq ($(WIND_HOST_TYPE),x86-win32) chmod 666 $(subst /,$(DIRCHAR),$@)endif ############################################################### Verify that the required WindML directories are present.#checkdir:ifeq ($(WIND_HOST_TYPE),x86-win32) @if not exist $(subst /,$(DIRCHAR),$(LIBDIR)) \ @mkdir $(subst /,$(DIRCHAR),$(LIBDIR))else @ - if [ -d $(LIBDIR) ] ; then \ echo ; \ else \ mkdir $(subst /,$(DIRCHAR),$(LIBDIR)) ; \ fiendif ############################################################### List the build targets # #listBld: @$(ECHO) ! Starting a build for: @$(ECHO) !ifneq ($(BLD_UGLA),) @$(ECHO) ! Building the WindML archiveendififneq ($(BLD_UGLO),) @$(ECHO) ! Building a standalone WindML objectendififneq ($(BLD_UGLE),) @$(ECHO) ! Building the WindML examplesendif @$(ECHO) ! ################################################################ Help build targets#helptip: @$(ECHO) ! @$(ECHO) ! Use make help for additional build targets @$(ECHO) !help: @$(ECHO) ! The WindML make file targets provide support for maintaining @$(ECHO) ! the WindML archive, and building a downloadable WindML object, @$(ECHO) ! and the WindML example programs. @$(ECHO) ! @$(ECHO) ! The build targets for maintaining the WindML archive are: @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! ugl (default) - @$(ECHO) ! Compiles each modified file and updates the WindML archive @$(ECHO) ! with the updated object files @$(ECHO) ! @$(ECHO) ! uglrclean/rclean - @$(ECHO) ! Recursively removes each object file and deletes the @$(ECHO) ! archive. Archive is only removed when build was from @$(ECHO) ! the WindML root. @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! uglclean/clean - @$(ECHO) ! Removes each object file in the current directory @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! Build targets for maintaining a downloadable WindML object, that @$(ECHO) ! contains all WindML functionality at the 2D layer along with the @$(ECHO) ! fonts and device drivers configured as per the configuration @$(ECHO) ! defined within target/src/ugl/config/uglInit.h. @$(ECHO) ! @$(ECHO) ! uglobj - @$(ECHO) ! Builds the WindML object file @$(ECHO) ! @$(ECHO) ! uglobjclean - @$(ECHO) ! Removes the WindML object file @$(ECHO) ! @$(ECHO) ! @$(ECHO) ! Build targets for maintaining the WindML demonstration programs @$(ECHO) ! @$(ECHO) ! ugldemo - @$(ECHO) ! Compiles each modified demo program creating a example.o. @$(ECHO) ! When this build target is entered at the WindML directory @$(ECHO) ! tree root, target/src/ugl, the build will also verify @$(ECHO) ! that the WindML archive is up to date and then link the @$(ECHO) ! example program against the WindML archive. The resulting @$(ECHO) ! object program is named example_ugl.o The example @$(ECHO) ! indicates the name of the example program, such as @$(ECHO) ! ugldemo_ugl.o @$(ECHO) ! @$(ECHO) ! ugldemoclean - @$(ECHO) ! Removes all the demonstration program object files @$(ECHO) !
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -