LQ Newbie
Registered: Jan 2012
Posts: 5
Rep:
|
regarding .DEFAULT in makefile
# -----------------------------------------------------------------------------------
# DESCRIPTION:
# This file contains make statements common to all projects.
# -----------------------------------------------------------------------------------
# Note that the path in includes below is relative to the CALLER.
include ../common/evolution_asms.make
include ../common/evolution_cs.make
include ../common/evolution_lib_cs.make
include ../common/evolution_z_cs.make
include ../common/sdk_cs.make
include ../common/www_gif.make
include ../common/www_html.make
include ../common/www_js.make
include ../common/www_mtxt.make
DATETIME = $(HYPERION)/utils/datetime.c
WEB_CS = \
$(if $(filter USE_BUILT_IN_WEB_FILES, $(DEFINES)), \
$(WORK_DIR)/webfiles.c \
$(addprefix $(WORK_DIR)/webfile_,$(addsuffix .c,$(notdir $(WEB_FILES)))) \
)
MINIMAL_WEB_CS = \
$(if $(filter USE_BUILT_IN_WEB_FILES, $(DEFINES)), \
$(WORK_DIR)/webfiles_minimal.c \
$(addprefix $(WORK_DIR)/webfile_,$(addsuffix .c,$(notdir $(MINIMAL_EMBEDDED_WEB_FILES)))) \
)
WWW_CSS = $(WEBMGR_WWW)/style.css
WWW_ICO = $(WEBMGR_WWW)/favicon.ico
WEB_FILES = $(WWW_COPY_FILES) $(WWW_PREPROCESS_FILES)
MINIMAL_EMBEDDED_WEB_FILES = $(WWW_MTXT)
WWW_COPY_FILES = $(WWW_CSS) $(WWW_GIF) $(WWW_ICO)
WWW_PREPROCESS_FILES = $(WWW_MTXT) $(WWW_JS) $(WWW_HTML)
ALL_WWW_FILES = $(addprefix $(WWW_DIR)/,$(notdir $(WEB_FILES)))
ALL_C_COMPILE_SOURCES = \
$(EVOLUTION_CS) \
$(EVOLUTION_Z_CS) \
$(SDK_CS) \
$(DATETIME)
# Produce evolution_defines.h
$(VARID_DIR)/evolution_defines.h : .makefile$(C_TOOL)
@echo $@
@echo "/* This file is automatically generated. */" > $@
@echo "/* DO NOT EDIT. */" >> $@
@echo "/* These definitions reflect values in use within library files. */" >> $@
@echo "#ifndef _DEFINED_EVOLUTION_DEFINES_" >> $@
@echo "#define _DEFINED_EVOLUTION_DEFINES_" >> $@
@echo $(DEFINES) | sed 's, ,\n,g' | sed -n '/=/s,=, ,p' | sed '/[^ ]\+/s,^,#define ,g' >> $@
@echo "#endif" >> $@
# Produce files based on varspec.m4d
$(VARID_DIR)/varid.h : $(APP_DIR)/cfg/varid_h.m4 $(APP_DIR)/cfg/varspec.m4d | .makefile$(C_TOOL)
@echo $<
@m4 -I$(APP_DIR)/cfg -D UNCONDITIONAL $(addprefix -D,$(DEFINES)) $< > $@
$(VARID_DIR)/varid.c : $(APP_DIR)/cfg/varid_c.m4 $(APP_DIR)/cfg/varspec.m4d | .makefile$(C_TOOL)
@echo $<
@m4 -I$(APP_DIR)/cfg -D UNCONDITIONAL $(addprefix -D,$(DEFINES)) $< > $@
$(VARID_DIR)/varid_server.c : $(APP_DIR)/cfg/varid_server_c.m4 $(APP_DIR)/cfg/varspec.m4d | .makefile$(C_TOOL)
@echo $<
@m4 -I$(APP_DIR)/cfg $(addprefix -D,UNCONDITIONAL IPC_SERVER_NAME=/tmp/ipc/evo.ipc $(DEFINES)) $< > $@
$(VARID_DIR)/varid_sort.txt : $(APP_DIR)/cfg/varid_sort.m4 $(APP_DIR)/cfg/varspec.m4d | .makefile$(C_TOOL)
@echo $<
@m4 -I$(APP_DIR)/cfg -D UNCONDITIONAL $(addprefix -D,$(DEFINES)) $< > $@.dat
@sort -g -u $@.dat > $@
@rm $@.dat
# @echo $$(notdir $$@)
define C_DEPENDENCY_template
$(WORK_DIR)/$(call MANGLE,$(1:.c=.d)): $(1) $(VARID_DIR)/evolution_defines.h | .makefile$(C_TOOL) $(VARID_DIR)/varid.h
@set -e; rm -f $$@; \
$(PRECC) -MM -MF '$$@.$$$$' -MQ '$$@' $(DEPENDENCY_INCLUDES) $(C_DEFINES) $$<; \
sed 's,\($*\)\.d[ :]*,\1.o $$@ : ,g' < $$@.$$$$ > $$@; \
rm -f $$@.$$$$
ifneq ($(MAKECMDGOALS),dump)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),distclean)
ifneq ($(MAKECMDGOALS),www_clean)
ifneq ($(MAKECMDGOALS),varspec)
-include $(WORK_DIR)/$(call MANGLE,$(1:.c=.d))
endif
endif
endif
endif
endif
endef
$(foreach FILE,$(ALL_C_COMPILE_SOURCES) $(EVOLUTION_LIB_CS),$(eval $(call C_DEPENDENCY_template, $(FILE)) ))
define COPY_template
www$(C_TOOL)/$(notdir $(1)): $(1) | .makefile$(C_TOOL)
@echo $$<
@cp $$< $$@
endef
define PREPROCESS_template
www$(C_TOOL)/$(notdir $(1)): $(1) | .makefile$(C_TOOL)
@echo $$<
@$(PRECC) -E -P -x c -C $(C_DEFINES) $$< > $$@
@sed --in-place '1,$$$$s/^[ \t]*//' $$@
endef
$(foreach FILE,$(WWW_COPY_FILES),$(eval $(call COPY_template, $(FILE)) ))
$(foreach FILE,$(WWW_PREPROCESS_FILES),$(eval $(call PREPROCESS_template, $(FILE)) ))
ifneq ($(filter USE_BUILT_IN_WEB_FILES,$(DEFINES)),)
define BUILD_FILE_STRUCT_template
$(WORK_DIR)/webfile_$(notdir $(1)).c: www$(C_TOOL)/$(notdir $(1))
@echo $$<
@echo "/* Generated by makefile */" > $$@
@echo "#include \"fastfile.h\"" >> $$@
@echo "const struct builtInWebFile Web_file_$(subst .,_,$(notdir $(1)))_contents = {" >> $$@
@echo "\"$(notdir $(1))\"", >> $$@
@ls -l -o $$< | sed -n '1{s/^\([^ \t]*[ \t]*\)\{3\}//;s/^\([^ \t]*\)[ \t].*/\1U,/;p}' >> $$@
@od -b -v $$< | sed -n '1,$$$${s/^.\{7\}//;s/ /\\/g;s/\(.*\)/"\1"/;p}' >> $$@
@echo "};" >> $$@
endef
$(foreach FILE,$(WEB_FILES),$(eval $(call BUILD_FILE_STRUCT_template, $(FILE)) ))
$(WORK_DIR)/webfiles.c: .makefile$(C_TOOL) ../common/www_gif.make ../common/www_html.make ../common/www_js.make ../common/www_mtxt.make
@echo $(basename $@)
@echo "/* Generated by makefile */" > $@
@echo "#include \"fastfile.h\"" >> $@
@echo "#define WEBFILE_REFERENCE(x) Web_file_ ## x ## _contents" >> $@
@echo >> $@
@for f in $(subst .,_,$(notdir $(WEB_FILES))); do \
echo "extern const struct builtInWebFile WEBFILE_REFERENCE($$f);" ; \
done >> $@
@echo $(if $(filter DSTNIEX, $(DEFINES)),"#pragma warn -ias") >> $@
@echo "const struct builtInWebFile *Web_file_contents[] = {" >> $@
@for f in $(subst .,_,$(notdir $(WEB_FILES))); do \
echo "&WEBFILE_REFERENCE($$f)," ; \
done >> $@
@echo "NULL /* No more files */" >> $@
@echo "};" >> $@
$(WORK_DIR)/webfiles_minimal.c: .makefile$(C_TOOL) ../common/www_mtxt.make
@echo $(basename $@)
@echo "/* Generated by makefile */" > $@
@echo "#include \"fastfile.h\"" >> $@
@echo "#define WEBFILE_REFERENCE(x) Web_file_ ## x ## _contents" >> $@
@echo >> $@
@for f in $(subst .,_,$(notdir $(MINIMAL_EMBEDDED_WEB_FILES))); do \
echo "extern const struct builtInWebFile WEBFILE_REFERENCE($$f);" ; \
done >> $@
@echo $(if $(filter DSTNIEX, $(DEFINES)),"#pragma warn -ias") >> $@
@echo "const struct builtInWebFile *Web_file_contents[] = {" >> $@
@for f in $(subst .,_,$(notdir $(MINIMAL_EMBEDDED_WEB_FILES))); do \
echo "&WEBFILE_REFERENCE($$f)," ; \
done >> $@
@echo "NULL /* No more files */" >> $@
@echo "};" >> $@
endif
.PHONY: mkdirs
@echo "i am in .PHONY:mkdirs"
mkdirs: work_mkdir www_mkdir
.PHONY: work_mkdir
work_mkdir:
@echo "i am in .PHONY work_mkdir"
@mkdir -p $(WORK_DIR)
.PHONY: www_clean www_mkdir
www_mkdir:
@echo "i am in www_clean www_mkdir"
@mkdir -p www$(C_TOOL)
www_clean:
@echo "i am in www_clean"
@rm -f .www$(C_TOOL) www$(C_TOOL)/*.*
.PHONY: www
ifeq ($(filter USE_BUILT_IN_WEB_FILES,$(DEFINES)),)
@echo "i am in .PHONY: www"
www: www_mkdir $(ALL_WWW_FILES)
endif
.DEFAULT:
lftp -c "debug 10; open -u admin,PASS $<; rm -r -f /http; mkdir /http/config; mput -O /http/config www$(C_TOOL)/*;"
# DO NOT DELETE
hi,
this is my common-linux.make file.my problem is compile the code the .default part is executing.that should be not executed where i have to do changes.
please can some one came across these problems share with me it will helpful.
regards
santhosh babu
|