Update of /cvsroot/libfunutil/libfunutil/toc/make
In directory sc8-pr-cvs1:/tmp/cvs-serv2488/toc/make
Added Files:
toc_functions.make toc_mainincludes.make
Log Message:
egg
--- NEW FILE: toc_functions.make ---
#!make
# ^^^ let's help out emacs :/
# this file contains more-or-less generic call()able Make functions.
######################################################################
# toc_atparse_file call()able:
# Similar to the toc shell function of the same name, except for different arguments:
# Filters an input file using toc's at-parser (e.g., @TOKENS@), and sends output to $2.
# $2 is only updated if the generated output is different, so it is dependencies-safe.
# Args:
# $1 = input template
# $2 = output file
# $3 = list of properties, e.g. FOO=bar BAR=foo
TOC_ATPARSER_BIN = $(toc_bindir)/atsign_parse
ifeq (,$(wildcard $(TOC_ATPARSER_BIN)))
$(error Could not find TOC_ATPARSER_BIN at $(TOC_ATPARSER_BIN)!)
endif
toc_atparse_file = \
$(TOC_ATPARSER_BIN) $(3) < $(1) > $(2).tmp; \
if cmp -s $(2).tmp $(2); then rm -f $(2).tmp; echo "$(2) is up to date."; \
else mv -f $(2).tmp $@; echo "Updated $(2)."; fi
######################################################################
# toc_generate_rules() callable:
# $1 = rules name, e.g., INSTALL_XXX, BIN_PROGRAMS, etc.
# $2 = arguments to pass to makerules.$(1)
# Sample:
# .toc.foo.deps:
# $(toc_generate_rules,foo,arg1=val1 -arg2)
# Executes script $(toc_makesdir)/makerules.foo, passing it $(2).
toc_generate_rules = $(toc_makesdir)/makerules.$(1) $(2)
######################################################################
# toc_get_makefile_var call()able:
# $1 = VAR_NAME
# $2 = optional filename (defaults to Makefile)
toc_get_makefile_var = $(shell $(toc_tocdir)/bin/getMakefileVar $(1) $(2))
#toc_get_makefile_var = $(shell fn=$(2); test -z "$$fn" && fn=Makefile; ${MAKE} -np -f $$fn | grep '^$(1)')
######################################################################
# toc_compile_c_binary call()able function:
# compiles/links list of source files [$($(1)_bin_SOURCES) $($(1)_bin_OBJECTS)and $(2)]
# to create $(1). It uses the optional $($(1)_bin_CFLAGS).
toc_compile_c_binary = $(CC) $(CFLAGS) $($(1)_bin_CFLAGS) -o $(1) $($(1)_bin_SOURCES) $($(1)_bin_OBJECTS) $(2)
######################################################################
# toc_made_c_deps call()able function:
# generates dependencies for c/c++ files.
# $1 = C/C++ sources to process.
# $2 = INCLUDES (e.g., -I. -I/usr/include, with or without the -I).
# $2 defaults to $(INCLUDES).
toc_make_c_deps = inc="$(patsubst %,-I%,$(wildcard $(patsubst -I%,%,$(2))))"; \
test -z "$$inc" && inc="$(INCLUDES)"; \
$(DEPSGEN_BIN) $$inc -- $(1)
--- NEW FILE: toc_mainincludes.make ---
include $(toc_makesdir)/toc_functions.make
include $(toc_makesdir)/cleaner.make
include $(toc_makesdir)/subdirs_traverser.make
include $(toc_makesdir)/deps.make
include $(toc_makesdir)/install.make
include $(toc_makesdir)/dist.make
|