Project

General

Profile

Bug #2422 » tutorial1.mak

make file - Randy Yates, 11/15/2013 07:13 PM

 
# To make the library from the command-line:
#
#make -f monitor.mak TARGET=<target> PLATFORM=<platform> lib
#
# (See make.cnf for a list of targets.)
#
# If a build depends on this library, include
# this make file and specify the dependency using the
# library directory, name and extension, like so:
#
#my_build : $(TUTORIAL1_DIR)tutorial1$(LIB) my_dependency2 my_dependency3 ...
# $(LN) ...
#
# Then also include the library's make file in your application's make file:
#
#include $(TUTORIAL1MAK_DIR)tutorial1.mak
#
# This build procedure is predicated on $(DSP_PROJECT_DIR)etc/make.cnf,
# which must be included by all make files.
#DSP_PROJECT_DIR = /home/yates/sw/phoenix/dsp/
include $(GCFWEB_SRC_PROJECT_ROOT_DIR)etc/make.cnf
TUTORIAL1_PROJECTNAME = tutorial1
TUTORIAL1_ROOT_DIR = $(GCFWEB_SRC_PROJECT_ROOT_DIR)app/examples/feature/dbo/
TUTORIAL1_SRC_DIR = $(TUTORIAL1_ROOT_DIR)
TUTORIAL1_INC_DIR = $(TUTORIAL1_ROOT_DIR)
TUTORIAL1_DEP_DIR = $(SCRATCH_DIR)$(TUTORIAL1_SRC_DIR)$(OBJ_DIR)
TUTORIAL1_OBJ_DIR = $(TUTORIAL1_DEP_DIR)
TUTORIAL1_OUT_DIR = $(TUTORIAL1_ROOT_DIR)
TUTORIAL1_OUT_NAME = $(TUTORIAL1_OUT_DIR)$(TUTORIAL1_PROJECTNAME)$(EXE)
TUTORIAL1_HEX_NAME = $(TUTORIAL1_OUT_DIR)$(TUTORIAL1_PROJECTNAME)$(HEXEXT)
TUTORIAL1_TMP_FILE = .directory_created

# Any extra ASM flags useful for this module
TUTORIAL1_ASMFLAGS = -g

# Any extra C flags useful for this module
TUTORIAL1_CFLAGS =

TUTORIAL1_INCLUDE_DIRS =

# common library files required for the tutorial1 module (libraries such as the C libraries are handled elsewhere)
TUTORIAL1_LIB_FILES = \

# C source files for the tutorial1 module
TUTORIAL1_C_SOURCE_FILES = \

# C++ source files for the tutorial1 module
TUTORIAL1_CPP_SOURCE_FILES = \
$(TUTORIAL1_PROJECTNAME) \

TUTORIAL1_ASM_SOURCE_FILES = \
$(TUTORIAL1_ASM_SOURCE_FILES_TARGET_DEPENDENT) \

# the executable target
exe : $(TUTORIAL1_OUT_NAME)

# link
$(TUTORIAL1_OUT_NAME) : \
$(foreach cppsrcfile, $(TUTORIAL1_CPP_SOURCE_FILES), $(TUTORIAL1_OBJ_DIR)$(cppsrcfile)$(OBJ)) \
$(foreach csrcfile, $(TUTORIAL1_C_SOURCE_FILES), $(TUTORIAL1_OBJ_DIR)$(csrcfile)$(OBJ)) \
$(foreach libfile, $(TUTORIAL1_LIB_FILES), $(COMMONLIB_LIB_DIR)$(libfile)$(LIB)) \
$(foreach asmsrcfile, $(TUTORIAL1_ASM_SOURCE_FILES), $(TUTORIAL1_OBJ_DIR)$(asmsrcfile)$(OBJ))
$(LN) $(LNFLAGS) $(TUTORIAL1_LNFLAGS)

# The object build rules for object files are specified here
$(TUTORIAL1_OBJ_DIR)%$(OBJ) : $(TUTORIAL1_SRC_DIR)%$(ASMEXT)
$(ASM) $(ASMFLAGS)

$(TUTORIAL1_OBJ_DIR)%$(OBJ) : $(TUTORIAL1_SRC_DIR)%.c
$(CC) $(TUTORIAL1_CFLAGS) $(CFLAGS)

$(TUTORIAL1_DEP_DIR)%.d: $(TUTORIAL1_SRC_DIR)%.c $(TUTORIAL1_DEP_DIR)$(TUTORIAL1_TMP_FILE)
$(SHELL) -ec 'gcc $(MM_CFLAGS) | sed '\''s;\($*\)\.\(o\|obj\)[ :]*;$(TUTORIAL1_OBJ_DIR)\1$(OBJ) $@ : ;g'\'' | tr -d '\''\015'\'' > $@; [ -s $@ ] || rm -f $@'

$(TUTORIAL1_OBJ_DIR)%$(OBJ) : $(TUTORIAL1_SRC_DIR)%.cpp
$(CPP) $(TUTORIAL1_CPPFLAGS) $(CPPFLAGS)

$(TUTORIAL1_DEP_DIR)%.dpp: $(TUTORIAL1_SRC_DIR)%.cpp $(TUTORIAL1_DEP_DIR)$(TUTORIAL1_TMP_FILE)
$(SHELL) -ec 'g++ $(MM_CPPFLAGS) | sed '\''s;\($*\)\.\(o\|obj\)[ :]*;$(TUTORIAL1_OBJ_DIR)\1$(OBJ) $@ : ;g'\'' | tr -d '\''\015'\'' > $@; [ -s $@ ] || rm -f $@'

# The TUTORIAL1 C file dependencies
ifeq (,$(findstring clean,$(MAKECMDGOALS)))
ifneq ($(MAKECMDGOALS),dir)
include $(foreach csrcfile, $(TUTORIAL1_C_SOURCE_FILES), $(TUTORIAL1_DEP_DIR)$(csrcfile).d)
include $(foreach cppsrcfile, $(TUTORIAL1_CPP_SOURCE_FILES), $(TUTORIAL1_DEP_DIR)$(cppsrcfile).dpp)
endif
endif

# include all library make files
ifneq (,$(TUTORIAL1_LIB_FILES))
include $(foreach library, $(TUTORIAL1_LIB_FILES), $(COMMONLIB_MAK_DIR)$(library)$(MAK))
endif

# The object directory creation rule
$(TUTORIAL1_OBJ_DIR)$(TUTORIAL1_TMP_FILE) dir :
$(MKDIR) -p $(TUTORIAL1_OBJ_DIR)
touch $(TUTORIAL1_OBJ_DIR)$(TUTORIAL1_TMP_FILE)

clean : cleantutorial1

cleanall : cleantutorial1 $(foreach libfile, $(TUTORIAL1_LIB_FILES), clean$(libfile))

cleantutorial1 :
-$(RM) $(TUTORIAL1_SRC_DIR)$(TUTORIAL1_PROJECTNAME)
-$(RM) $(TUTORIAL1_SRC_DIR)$(TUTORIAL1_PROJECTNAME)$(MAP)
-$(RM) $(TUTORIAL1_OBJ_DIR)*
-$(RM) $(TUTORIAL1_DEP_DIR)*.d
-$(RM) $(TUTORIAL1_DEP_DIR)$(TUTORIAL1_TMP_FILE)
-$(RMDIR) $(TUTORIAL1_DEP_DIR)
-$(RM) $(TUTORIAL1_HEX_NAME)
-$(RM) $(TUTORIAL1_OUT_NAME)
-$(RM) $(TUTORIAL1_SRC_DIR)*~

######## following items are related to testing and verification ########
run : $(TUTORIAL1_OUT_NAME)
$(TUTORIAL1_OUT_NAME) --docroot . --http-address 0.0.0.0 --http-port 9090

(2-2/3)