default : all ######################################################################## # # Timestamps to record incremental progress # stamp_tc := $(generate_dir)/stamp-tc stamp_cache := $(generate_dir)/stamp-cache ######################################################################## # # What's what, and what depends upon what # # The order of the following lines is quite particular. # depends_mk := $(generate_dir)/depends.mk include $(config_mk_dir)/config.mk include $(mk_dir)/$(context).mk include $(mk_dir)/$(strategy).mk objects := $(sources:.c=.o) assemblys := $(sources:.c=.s) preprocessed := $(sources:.c=.i) ######################################################################## # # Various and sundry supporting makefile fragments # makefile := $(generate_dir)/GNUmakefile include $(mk_dir)/$(goal).mk include $(backend_mk_dir)/$(backend).mk ######################################################################## # # Prebuilt Titanium class library # ifneq "$(prebuilt_tlib)" "" tlib_includes := -I$(tlib_include_dir) tlib_ld_libs := -ltlib-$(backend)-$(prebuilt_tlib) endif ######################################################################## # # Command options for Titanium compiler, C compiler, and linker # # The "clean" versions avoid any mention of $(generate_dir), and # therefore are suitable for validating cache entries. # clean_tc_command := CLASSLIB=$(classlib) $(tc) $(tc_flags) tc_command := $(clean_tc_command) -outdir $(generate_dir) clean_includes := $(tlib_includes) $(context_includes) $(backend_includes) clean_cc_flags := $(cc_flags) $(backend_defines) $(clean_includes) clean_cc_command := $(cc) $(clean_cc_flags) unclean_includes := -I$(generate_dir) all_includes := $(clean_includes) $(unclean_includes) all_cc_flags := $(clean_cc_flags) $(unclean_includes) cc_command := $(clean_cc_command) $(unclean_includes) all_ld_flags := $(ld_flags) $(backend_ld_flags) $(context_ld_flags) all_ld_libs := $(ld_libs) $(tlib_ld_libs) $(backend_ld_libs) @LIBM@ ######################################################################## # # Provide the requested level of feedback # export silent ifeq "$(silent)" "0" message := @echo pipe_demangler := | $(demangler) else message := @: progress := endif message_link = $(message) Linking $(outfile) ... ######################################################################## # # Cleaning up after a successful or unsuccessful build # always_cleanup := $(cleanup) $(generate_dir) ifeq "$(keep_intermediate)" "0" final_cleanup := $(always_cleanup) else final_cleanup := : endif or_cleanup := || { $(final_cleanup); false; } ######################################################################## # # Targets # $(stamp_tc) : $(makefile) [ -d $(generate_dir) ] && $(cleanup) $(generate_dir) [ -d $(generate_dir) ] || mkdir -p $(generate_dir) $(message) Running Titanium compiler ... $(tc_command) $(ti_sources) touch $@ $(depends_mk) : $(makedepend) $(stamp_cache) $(message) Checking dependencies ... $(makedepend) $(all_cc_flags) -- $(generate_dir)/*.c > $@ echo "sources := " $(generate_dir)/*.c >> $@ .PHONY: assembly preprocess assembly : $(assemblys) preprocess : $(preprocessed) all : $(outfile) touch $<