LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-05-2012, 01:39 AM   #1
santhosh-e
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Makefile to not default directories TheSergon13 Linux - Software 2 06-04-2010 04:48 AM
Is it mandatory to have the name of the makefile as 'Makefile' for kernal module comp narender.d Linux - Kernel 3 05-29-2009 06:26 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration