Update of /cvsroot/pclasses/pclasses2/toc/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6599/make Added Files: BIN_PROGRAMS.make C_BINS_FROM_SOURCES.make c_bins.make C_DEPS.make cleaner.make cpp_bins.make cpp_dynamic_libs.make cpp_helper.make cpp_lib_testapp.make cpp_static_libs.make deps.make dist.make DOXYGEN.make FILE_FILTERS.make flex.make headers_symlinks.make install.380.make install.make INSTALL_XXX.make LYX_EXPORT.make lyxport.make LYXPORT.make Makefile makerules.BIN_PROGRAMS makerules.C_BINS_FROM_SOURCES makerules.FILE_FILTERS makerules.INSTALL_XXX makerules.LYX_EXPORT makerules.LYXPORT makerules.QMAKE2MAKE makerules.QT_MOC_DEPS makerules.RSYNC makerules.SCP makerules.SHARED_LIBS makerules.STATIC_LIBS makerules.TARBALL mkdirs.make NAMESPACE.make PCH.make qmake2make.make QMAKE2MAKE.make QT_MOC_DEPS.make qt_moc.make qt.sh RSYNC.make SCP.make SHARED_LIBS.make STATIC_LIBS.make subdirs_traverser.make symlinker.make symlink_headers.make SYMLINK_HEADERS.make TARBALL.make tests.make toc_functions.make toc.make.at toc.qmake.at Log Message: egg --- NEW FILE: BIN_PROGRAMS.make --- # toc makefile snippet to link binaries. # # Usage: # define these vars: # BIN_PROGRAMS = somename anothername # BIN_PROGRAMS_LDADD (optional - list of libs to link to all BIN_PROGRAMS) # # For each FOO in BIN_PROGRAMS, define: # FOO_bin_OBJECTS = list of .o files for FOO # FOO_bin_LDADD = optional arguments to pass to linker, e.g. -lstdc++ # # Then include this file: # # include $(TOC_MAKESDIR)/BIN_PROGRAMS.make # # and add 'bins' somewhere in your dependencies, e.g.: # # all: bins BIN_PROGRAMS_MAKEFILE = $(TOC_MAKESDIR)/BIN_PROGRAMS.make ifeq (1,$(configure_with_CYGWIN)) BIN_PROGRAMS_LDADD += -lcygwin endif # toc_link_binary call()able function: # $1 = binary file name # $2 = optional arguments to linker. # list of objects to link is derived from $($(1)_bin_OBJECTS) and $(BIN_PROGRAMS_OBJECTS) toc_link_binary = $(CXX) -o $(1) $($(1)_bin_OBJECTS) $(BIN_PROGRAMS_OBJECTS) $(LDFLAGS) $($(1)_bin_LDADD) $(BIN_PROGRAMS_LDADD) $(2) ifneq (,$(BIN_PROGRAMS)) ifeq (1,$(configure_with_CYGWIN)) CLEAN_FILES += $(addsuffix .exe,$(BIN_PROGRAMS)) CLEAN_FILES += $(wildcard *.exe.stackdump) else CLEAN_FILES += $(wildcard $(BIN_PROGRAMS)) endif BIN_PROGRAMS_DEPSFILE = .toc.BIN_PROGRAMS.make BIN_PROGRAMS_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.BIN_PROGRAMS BIN_PROGRAMS_COMMON_DEPS += Makefile $(BIN_PROGRAMS_MAKEFILE) $(BIN_PROGRAMS_OBJECTS) $(BIN_PROGRAMS_DEPSFILE): Makefile $(BIN_PROGRAMS_RULES_GENERATOR) $(BIN_PROGRAMS_MAKEFILE) ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping BIN_PROGRAMS rules generation." else @echo "Generating BIN_PROGRAMS rules."; \ $(call toc_generate_rules,BIN_PROGRAMS,$(BIN_PROGRAMS)) > $@ endif -include $(BIN_PROGRAMS_DEPSFILE) deps: $(BIN_PROGRAMS_DEPSFILE) strip-bins: strip $(BIN_PROGRAMS) clean-bins: @test -n "$(BIN_PROGRAMS)" || exit 0; \ echo "Deleting: $(BIN_PROGRAMS)"; \ rm $(BIN_PROGRAMS) > /dev/null || true; run-bins: @LD_LIBRARY_PATH="$${LD_LIBRARY_PATH}:$${PWD}:$(top_src)/libdir"; \ for i in $(BIN_PROGRAMS); do \ echo "Running $$i"; ./$$i || exit $$?; done bins: BIN_PROGRAMS endif # ^^^ got $(BIN_PROGRAMS) ??? --- 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 = \ echo -n '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 $(2); 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 = $(SHELL) $(TOC_MAKESDIR)/makerules.$(1) $(2) # the $(SHELL) prefix here is a kludge: systems where /bin/sh is Bourne # fail to build, but the nature of the errors makes it quite difficult # to track down where the failure is. The side-effect of this kludge # is that makerules.foo must be a shell script. :/ ###################################################################### # toc_get_makefile_var call()able: # $1 = VAR_NAME # $2 = optional filename (defaults to Makefile) toc_get_makefile_var = $(shell $(TOC_HOME)/bin/getMakefileVar $(1) $(2)) ###################################################################### # 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) $(C_BINS_FROM_SOURCES_CFLAGS) $(CFLAGS) $($(1)_bin_CFLAGS) -o $(1) $($(1)_bin_SOURCES) $($(1)_bin_OBJECTS) $(2) $(C_BINS_FROM_SOURCES_LFLAGS) $(LDFLAGS) $($(1)_bin_LFLAGS) # does $(LDFLAGS) /really/ belong here??? ###################################################################### # toc_made_c_deps call()able function: # generates make 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 "x$$inc" = "x" && inc="$(INCLUDES)"; \ $(TOC_MKDEP_BIN) $$inc -- $(1) # the $(wildcard) oddness above is to remove duplicate entires and invalid # dirs (mkdeps no likie invalid ones). # maintenance note: $(TOC_MKDEP_BIN) comes from C_DEPS.make ifneq (,$(CCDV_BIN)) COMPILE_COMMAND_QUIET_PREFIX = @ else COMPILE_COMMAND_QUIET_PREFIX = endif ###################################################################### # Experimental override of %.o:%.cpp COMPILE_COMMAND_CXX = $(CXX) $(CXXFLAGS) $($(subst .,_,$<)_CXXFLAGS) \ $(CPPFLAGS) $($(subst .,_,$<)_CPPFLAGS) $($(<).CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< # ^^^ ..._CPPFLAGS == e.g., main.cpp.CPPFLAGS or main_cpp_CPPFLAGS %.o: %.cpp $(COMPILE_COMMAND_QUIET_PREFIX)$(COMPILE_COMMAND_CXX) ###################################################################### # Experimental override of %.o:%.c COMPILE_COMMAND_C = $(CC) $(CFLAGS) $($(subst .,_,$<)_CFLAGS) \ $(CPPFLAGS) $($(subst .,_,$<)_CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< %.o: %.c $(COMPILE_COMMAND_QUIET_PREFIX)$(COMPILE_COMMAND_C) --- NEW FILE: symlinker.make --- # Makefile snippet to create symlinks. # # sample usage: # default: all # SYMLINKS = $(wildcard somedir/*.h) # include path/to/this_file # all: links $(SYMLINKS): @if test -e $@ -a ! -e `basename $@`; then \ link="ln -s $@ ."; \ echo $$link; \ test -L $@ && continue; \ test -f $@ && $$link || echo "link failed!"; \ fi .PHONY: links $(SYMLINKS) # todo: figure out how to do this in the context of the qmake-driven build: #ifneq($(USE_PCH),'') # @if test ! -L $(notdir $@.pch); then \ # link="ln -s $@.pch ."; \ # echo $$link; \ ### test -L $@.pch && continue; \ ### test -f $@.pch && $$link || echo "link failed!"; \ # $$link || echo "link failed!"; \ # fi #endif links: $(SYMLINKS) clean: cleanlinks cleanlinks: @cleanfiles= ; \ for f in $(notdir $(SYMLINKS)); do \ if test -L $$f; then \ cleanfiles="$$cleanfiles $$f"; \ fi; \ if test -L $$f.pch; then \ cleanfiles="$$cleanfiles $$f.pch"; \ fi; \ done; \ if test -n "$$cleanfiles"; then \ echo rm $$cleanfiles; \ rm $$cleanfiles; \ fi --- NEW FILE: C_DEPS.make --- #!/do/not/make # makefile snippet # Usage: # include path/to/this/file # # That will set up a 'deps' target which deps all C/C++ files and updates # the deps when any of those files, or the Makefile, changes. # That's normally all there is to it. # # Note that generated sources which do not exist when this snippet is # loaded will not be depped. Since that normally only happens on # a first-time build, when everything is re-built anyway, this is # not a practical problem. DEPS_C_SOURCES_GLOB ?= *.cpp *.c *.c++ *.C *.cc *.moc # *.h *.hpp *.h++ *.hxx SOURCE_FILES_TO_DEP ?= $(sort $(wildcard $(DEPS_C_SOURCES_GLOB))) TOC_C_DEPS_MAKEFILE = $(TOC_MAKESDIR)/C_DEPS.make TOC_MKDEP_SRC = $(TOC_HOME)/bin/mkdep.c TOC_MKDEP_BIN = $(top_srcdir)/mkdep $(TOC_MKDEP_BIN): $(TOC_C_DEPS_MAKEFILE) $(TOC_MKDEP_SRC) @$(call toc_compile_c_binary,$@,$(TOC_MKDEP_SRC)) DISTCLEAN_FILES += $(TOC_MKDEP_BIN) ifneq (,$(SOURCE_FILES_TO_DEP)) # We've got sources. Let's dep 'em... TOC_C_DEPSFILE = .toc.C_DEPS.make $(TOC_C_DEPSFILE): $(TOC_MKDEP_BIN) $(SOURCE_FILES_TO_DEP) Makefile $(TOC_C_DEPS_MAKEFILE) ifneq (,$(strip $(filter clean distclean,$(MAKECMDGOALS)))) @echo "$(MAKECMDGOALS): skipping C_DEPS rules generation." else @test -n "$(SOURCE_FILES_TO_DEP)" || exit 0; \ echo "Generating C_DEPS rules for $(DEPS_C_SOURCES_GLOB)"; \ $(call toc_make_c_deps,$(SOURCE_FILES_TO_DEP),) > $@ -include $(TOC_C_DEPSFILE) endif C_DEPS: $(TOC_C_DEPSFILE) deps: C_DEPS CLEAN_FILES += $(TOC_C_DEPSFILE) all: C_DEPS else # no sources to dep. Set up a dummy target. C_DEPS: endif --- NEW FILE: qt_moc.make --- # This is out-moded. Don't use it. # # manages moc file dependencies and compiling for Qt moc sources. # # Usage: # include $(TOC_MAKESDIR)/qt_moc.make # # Effects: # - moc_*.* are managed for you (deps, compiling QT_MOC_MAKEFILE = $(TOC_MAKESDIR)/qt_moc.make QT_MOC_DEPSFILE = .toc.QT_MOC_DEPS.make moc_%.cpp: @in=$@; in=$${in%%.cpp}.h; in=$${in##moc_}; \ cmd="$(MOC) $$in -o $@"; echo $$cmd; $$cmd QT_MOC_RULESGEN = $(TOC_MAKESDIR)/makerules.QT_MOC_DEPS QT_MOC_DEPS: $(QT_MOC_DEPSFILE) $(QT_MOC_DEPSFILE): Makefile $(QT_MOC_MAKEFILE) $(QT_MOC_RULESGEN) @echo "Generating moc file dependencies..."; \ $(QT_MOC_RULESGEN) > $@ include $(QT_MOC_DEPSFILE) deps: QT_MOC_DEPS mocs: QT_MOC_DEPS $(QT_MOC_OUT_SOURCES) all: QT_MOC_DEPS --- NEW FILE: qt.sh --- # toc_run_description = looking for Qt $1 # toc_begin_help = # Calls toc_export for the following: # - QTINCDIR directory containing Qt headers # - QTLIBDIR directory containing Qt libraries # - QTBINDIR directory containing Qt tools (moc, uic, etc.) # - LQT set to "-lqt" # - UIC /path/to/uic # - MOC /path/to/moc # - QMAKE /path/to/qmake # - QT_INCLUDES -I/path/to/Qt/includes # - QT_LDFLAGS -L/path/to/Qt/libs # Also, QTINCDIR, QTLIBDIR, and QTBINDIR are set in the environment. Note # that this intentionally does not set QTDIR, to keep you from using # $QTDIR/bin etc. instead of the QTBINDIR which might have been specified # by the user. # # If you need a specific version of Qt, set both of the following variables # before running this test: # qt_required_version - human-readable version number like "3.1.x" # qt_required_version_glob - version glob like "3.1.*" # Optionally, pass the version as $1 and glob as $2 (be sure to quote the # glob!). # = toc_end_help qt_required_version_version=${1-${qt_required_version_version-'3.x'}} qt_required_version_glob=${2-${qt_required_version_glob-'3.*'}} qt_check_dir () { local var=$1 local dir=$2 local contents=$3 if test -z "$dir"; then cat<<EOF $var environment variable not set, and --with-${var}=... not passed! Use one or the other to point to your Qt $contents, or QTDIR or --with-QTDIR=... to point to the top of your Qt installation. EOF return 1 fi if test -d $dir; then # life is tolerable return 0 else cat<<EOF Directory $dir does not exist! Set the $var environment variable, or pass --with-${var}=... to point to your Qt $contents, or QTDIR or --with-QTDIR=... to point to the top of your Qt installation. EOF return 1 fi } # Use --with-QTDIR=... if we got it; otherwise default to $QTDIR. QTDIR=${configure_with_QTDIR-$QTDIR} toc_export configure_with_qt=0 toc_export HAVE_QT=0 if test -z "${QTDIR}"; then echo "error: either set QTDIR or pass in --with-QTDIR=/path/to/qt" return 1 fi # QTINCDIR/QTLIBDIR/QTBINDIR can be specified independently, in the # environment or on the command line, or we can guess them from QTDIR. QTINCDIR=${configure_with_QTINCDIR-${QTINCDIR-${QTDIR+$QTDIR/include}}} QTLIBDIR=${configure_with_QTLIBDIR-${QTLIBDIR-${QTDIR+$QTDIR/lib}}} QTBINDIR=${configure_with_QTBINDIR-${QTBINDIR-${QTDIR+$QTDIR/bin}}} qt_check_dir QTINCDIR "$QTINCDIR" headers || return 1 qt_check_dir QTLIBDIR "$QTLIBDIR" libraries || return 1 qt_check_dir QTBINDIR "$QTBINDIR" executables || return 1 if test -n "$qt_required_version"; then # This has to be libqt*.so, not libqt.so, because in some cases you # have only libqt-mt.so.x.y.z, and libqt.so is a symlink to that, and # there are no libqt.so.x.y.z symlinks. (At least that's the way it # is with Qt 3.1.1 built from source on my RedHat 8.0 box.) ls $QTLIBDIR/libqt*.so.${qt_required_version_glob} > /dev/null 2>&1 || { echo "Qt $qt_required_version (libqt*.so.$qt_required_version_glob) not found in $QTLIBDIR!" return 1 } echo "Found Qt $qt_required_version at ${QTLIBDIR}" fi export QTDIR export QTINCDIR export QTLIBDIR export QTBINDIR toc_export QTDIR=$QTDIR toc_export QTINCDIR=$QTINCDIR toc_export QTLIBDIR=$QTLIBDIR toc_export QTBINDIR=$QTBINDIR toc_export LQT=-lqt toc_export UIC=${UIC:-$QTBINDIR/uic} toc_export MOC=${MOC:-$QTBINDIR/moc} toc_export QMAKE=${QMAKE:-$QTBINDIR/qmake} toc_export QT_INCLUDES="-I${QTINCDIR}" toc_export QT_LDFLAGS="-L${QTLIBDIR}" configure_with_qt=1 toc_export configure_with_qt=1 toc_export HAVE_QT=1 return 0 --- NEW FILE: Makefile --- #!/usr/bin/make -f default: all include toc.make DIST_FILES += $(wildcard *.make *.at makerules.*) --- NEW FILE: makerules.LYXPORT --- #!/bin/sh # Creates makefile rules for use with LYXPORT.make test 0 = ${#@} && { echo "usage: $0 file1.lyx [... fileN.lyx]" exit 1 } thisapp="\$(TOC_MAKESDIR)/makerules.LYXPORT" filters_makefile="\$(TOC_MAKESDIR)/LYXPORT.make" exts="pdf html ps" echo "############################## LYXPORT rules:" for t in "$@"; do echo "###################### ${t}:" echo -n "CLEAN_FILES += " for ext in $exts; do echo -n ${t%%.lyx}.$ext" " done echo cat <<EOF ${t}_LYXPORT_ARGS ?= \$(LYXPORT_ARGS) .PHONY: lyxport-${t} LYXPORT-${t} lyxport-${t}: \$(LYXPORT_BIN) \$(${t}_LYXPORT_ARGS) ${t} \$(${t}_LYXPORT_DEST) root=\$(patsubst %.lyx,%,${t}); \\ for x in $exts; do \\ mv \$\$root/\$\$root.\$\$x . || exit; \\ done; \\ \$(PERL_BIN) -i -pe "s|\$\${root}.html||g" \$\${root}.html || exit; \\ rm -fr \$\${root} # that perl call cleans up the self-links in the html file, because # such links break if you rename the html file (as i always do :/) LYXPORT: lyxport-${t} LYXPORT-${t}: lyxport-${t} lyxport: lyxport-${t} LYXPORT-post: LYXPORT-${t} ###################### /${t} EOF done echo "LYXPORT: LYXPORT-post" echo "lyxport: LYXPORT-post" echo "LYXPORT-post:" echo "# implement the LYXPORT-post target to implement post-lyxport logic." echo "############################## end LYXPORT rules" --- NEW FILE: deps.make --- # deprecated file. It's replacement is: include $(TOC_MAKESDIR)/C_DEPS.make --- NEW FILE: makerules.C_BINS_FROM_SOURCES --- #!/bin/sh # creates some makefile code for the $(C_BINS_FROM_SOURCES) var test -z "$1" && { echo "usage: $0 appone [apptwo ...]" exit 1 } echo "C_BINS_FROM_SOURCES_COMMON_DEPS += $0" cat <<EOF ifneq (,\$(CCDV_BIN)) C_BINS_FROM_SOURCES_QUIET_PREFIX = @ else C_BINS_FROM_SOURCES_QUIET_PREFIX = endif EOF for t in $@; do cat <<EOF $t: \$(C_BINS_FROM_SOURCES_COMMON_DEPS) \$(${t}_bin_SOURCES) \$(${t}_bin_OBJECTS) \$(C_BINS_FROM_SOURCES_QUIET_PREFIX)\$(call toc_compile_c_binary,${t},) CLEAN_FILES += $t bin-$t: $t bins: bin-$t EOF done --- NEW FILE: cpp_dynamic_libs.make --- # deprecated file. It's replacement is: include $(TOC_MAKESDIR)/SHARED_LIBS.make --- NEW FILE: mkdirs.make --- # Use like this: # MKDIRS = list of dirs # include $(top_makefilesdir)/mkdirs.make # mytarget: $(MKDIRS) # # That's it! That's look for those dirs, create them if they # don't exist, and exit if it can't make one. mkdir=mkdir ## mkdir=mkdirhier $(MKDIRS): @test -d $@ || $(mkdir) $@ && exit 0; \ echo "Failed to create dir [$@]!"; \ exit 1; --- NEW FILE: cpp_static_libs.make --- # deprecated file. It's replacement is: include $(TOC_MAKESDIR)/STATIC_LIBS.make --- NEW FILE: cleaner.make --- #!/usr/bin/make -f # Usage: # # CLEAN_FILES += *~ foo bar # DISTCLEAN_FILES += nekkid_pic_of_mrs_walters.jpg # include path/to/this/file # # That creates 'clean' and 'distclean' targets which will nuke those files/dirs. # # Special case: cleaning subdirs in an order other than that specified in $(SUBDIRS): # # Set TOC_OVERRIDE_CLEAN to 1 /before including toc.make/ in any given # makefile in order to have 'clean' clean/distclean targets, i.e., one you can # re-order all you want by using dependencies. # e.g.: # clean: $(addprefix clean-,bin sbin lib doc tests .) # or: # clean: precleaner subdirs-clean clean-. aftercleaner # # If you do this the default clean/distclean behaviour will be to do NOTHING, # so you must be sure to set the dist/clean deps. .PHONY: clean distclean clean-. CLEAN_FILES += $(DEPS_FILE) $(DIST_LISTFILE) ###################################################################### # toc_clean_files call()able function: deletes all files passed in via # $(1). toc_clean_files = test "x$(1)" = "x" && exit 0; \ for x in $(1) ""; do test -z "$${x}" && continue; \ test -w $$x || continue; \ rmargs=""; test -d $$x && rmargs="-rf"; \ rm $$rmargs $$x || exit; \ done; \ exit 0 clean-%: # assume $* is a subdirectory @$(call toc_make_subdirs,$*,clean) distclean-%: # assume $* is a subdirectory @$(call toc_make_subdirs,$*,distclean) clean-.: clean-subdirs ifeq (1,$(configure_build_quietly)) @echo "Cleaning up..."; \ $(call toc_clean_files,$(wildcard $(CLEAN_FILES))) else @echo "Cleaning up: $(wildcard $(CLEAN_FILES))"; \ $(call toc_clean_files,$(wildcard $(CLEAN_FILES))) # i hate the duplicate wildcard, but i can't pass shell-expanded vars # to $(call ...). endif distclean-.: distclean-subdirs @echo -n "Cleaning up... " ifeq (1,$(configure_build_quietly)) @$(call toc_clean_files,$(wildcard $(CLEAN_FILES) $(DISTCLEAN_FILES))); \ echo else @echo $(wildcard $(CLEAN_FILES) $(DISTCLEAN_FILES)); \ $(call toc_clean_files,$(wildcard $(CLEAN_FILES) $(DISTCLEAN_FILES))) endif subdirs-clean: # implemented elsewhere subdirs-distclean: # implemented elsewhere clean-subdirs: subdirs-clean distclean-subdirs: subdirs-distclean # toc-XXX stubs: don't use these directly #toc-clean: subdirs-clean clean-. #toc-distclean: subdirs-distclean distclean-. # we clean depth-first to keep some top-level generated files from being nuked :/ ifeq (1,$(TOC_OVERRIDE_CLEAN)) clean: distclean: else clean: clean-. distclean: distclean-. endif --- NEW FILE: toc.make.at --- #!/bin/make # # toc.make.at: template makefile for toc.make, a core concept of the # toc build process. This is filtered at the end of the configure # process. toc.make must be included by your Makefiles. # # All of the "at-vars" in this file are expected to come in # via the configure process, either from core tests or from # the core itself. # # Ideally this file should be free of project-specific code: # put that in $(top_srcdir)/toc.$(PACKAGE_NAME).make.at and # in $(top_srcdir)/configure.$(PACKAGE_NAME) run: # toc_test_require toc_project_makefile SHELL = @SHELL@ default: all all: FORCE: ; @true # try to save some grief later: .toc.%: $(wildcard *) ifneq (,$(strip $(filter distclean clean,$(MAKECMDGOALS)))) MAKING_CLEAN = 1 else MAKING_CLEAN = 0 endif #PACKAGE_VERSION = @PACKAGE_VERSION@ #PACKAGE_NAME = @PACKAGE_NAME@ top_srcdir = @TOP_SRCDIR@ retoc: @echo "Cleaning up .toc.*"; ls="$$(ls .toc.* 2>/dev/null)"; test x = "x$ls" && exit 0; \ rm $$ls; ${MAKE} $$ls PACKAGE_NAME = @PACKAGE_NAME@ ##### include configure-created code: toc_config_vars = $(top_srcdir)/toc.$(PACKAGE_NAME).configure.make include $(toc_config_vars) ##### DESTDIR is for autotools 'make install' compatibility ifneq (,$(DESTDIR)) DESTDIR := $(DESTDIR)/ endif ##### some conventional vars: prefix ?= @prefix@ top_includesdir = $(top_srcdir)/include top_libdir = $(top_srcdir)/lib top_bindir = $(top_srcdir)/bin toc_project_makefile = $(wildcard $(top_srcdir)/toc.$(PACKAGE_NAME).make) toc_project_makefile_at = $(wildcard $(top_srcdir)/toc.$(PACKAGE_NAME).make.at) TOC_HOME ?= @TOC_HOME@ # todo: check if this is under $(top_srcdir), so we can make this path relative. ##### deprecated: toc_topdir ?= $(TOC_HOME) toc_makesdir ?= $(TOC_HOME)/make toc_bindir ?= $(TOC_HOME)/bin # replacements are below... ##### TOC_MAKESDIR = $(TOC_HOME)/make TOC_BINDIR = $(TOC_HOME)/bin TOC_SBINDIR = $(TOC_HOME)/sbin TOC_PWD_FROM_TOPSRC = @TOC_RELATIVE_DIR@ # e.g., in lib/foo, TOC_PWD_FROM_TOPSRC == lib/foo TOC_MAKE = toc.make TOP_TOC_MAKE = $(top_srcdir)/$(TOC_MAKE) ############################################################ # Experimental: auto-run configure if we think we need to # Run configure with --enable-auto-reconfigure to get it. ifeq (1,$(configure_enable_auto_reconfigure)) $(TOC_MAKE): $(TOC_MAKESDIR)/$(TOC_MAKE).at \ $(toc_project_makefile_at) \ $(top_srcdir)/configure $(top_srcdir)/configure.$(PACKAGE_NAME) @echo "$@ dependencies updated: [$?]. Reconfiguring..."; \ touch $@; ${MAKE} toc-reconfigure toc-reconfigure: $(TOC_MAKE) cd $(top_srcdir); ./configure $(CONFIGURE_ARGUMENTS) ifneq (,$(toc_config_vars)) $(toc_config_vars): $(TOC_MAKE) endif endif # end autoreconfigure ############################################################3 ##### some core utilities: AWK_BIN = @AWK@ PERL_BIN = @PERL@ SED_BIN = @SED@ TAR_BIN = @TAR@ GZIP_BIN = @GZIP@ BZIP_BIN = @BZIP@ ZIP_BIN = @ZIP@ INSTALLER_BIN = @INSTALLER_BIN@ TOC_MAKEDIST_BIN = @TOC_MAKEDIST_BIN@ DIST_FILES += Makefile TOC_EMOTICON_OKAY=@TOC_EMOTICON_OKAY@ TOC_EMOTICON_WARNING= @TOC_EMOTICON_WARNING@ TOC_EMOTICON_ERROR=@TOC_EMOTICON_ERROR@ # TOC_SHARED_MAKEFILE is deprecated! TOC_SHARED_MAKEFILE = $(wildcard $(top_srcdir)/@TOC_SHARED_MAKEFILE@) ifneq (,$(TOC_SHARED_MAKEFILE)) include $(TOC_SHARED_MAKEFILE) endif CLEAN_FILES += $(wildcard .toc.* core *~) DISTCLEAN_FILES += $(wildcard \ $(TOC_MAKE) toc.qmake \ $(TOC_SHARED_MAKEFILE) toc_shared.qmake \ toc.$(PACKAGE_NAME).make \ toc.$(PACKAGE_NAME).configure.make \ ) ifeq (.,$(top_srcdir)) DISTCLEAN_FILES += toc.$(PACKAGE_NAME).configure.make endif ##################################################### some common C/C++ stuff: # C*FLAGS come from the gnu_cpp_tools toc test: CONFIG_H = $(wildcard $(top_includesdir)/config.h) INCLUDES += -I. ifneq (,$(CONFIG_H)) INCLUDES += -I$(top_srcdir)/include CPPFLAGS += -DHAVE_CONFIG_H=1 endif ifeq (1,$(configure_cpp_debug)) CPPFLAGS += -g endif CPPFLAGS += $(INCLUDES) $(WARN) $(CFLAGS_OPT) ##################################################### end C/C++ stuff ######################################################################## # configure_build_quietly IS GOING AWAY! DON'T USE IT configure_build_quietly = 0 ######################################################################## # CCDV_BIN: see TOC_HOME/bin/ccdv.c for details. This is a compiler # front-end to pretty up C/C++ compiler output. # We set this BEFORE INCLUDING PROJECT-SPECIFIC MAKEFILE CODE so # the ifeq()-based rules will behave properly. CCDV_BIN = $(wildcard $(top_srcdir)/ccdv) ifneq (,$(CCDV_BIN)) CC := $(CCDV_BIN) $(CC) CXX := $(CCDV_BIN) $(CXX) AR := $(CCDV_BIN) $(AR) ifeq (.,$(top_srcdir)) DISTCLEAN_FILES += $(CCDV_BIN) endif endif # /CCDV_BIN ######################################################################## include $(TOC_MAKESDIR)/toc_functions.make include $(TOC_MAKESDIR)/cleaner.make include $(TOC_MAKESDIR)/subdirs_traverser.make include $(TOC_MAKESDIR)/C_DEPS.make include $(TOC_MAKESDIR)/INSTALL_XXX.make include $(TOC_MAKESDIR)/dist.make #### finally, get the project-specific code: ifneq (,$(toc_project_makefile)) include $(toc_project_makefile) endif --- NEW FILE: cpp_lib_testapp.make --- # makefile snippet for running e-based apps # If you are going to include cpp_{static,dynamic}_lib.make, You should # include those before including this one. # # you must define: # THISLIB_TESTS = list of app names # then include this file. # for each FOO in $(THISLIBLIB_TESTS) you must have the file FOO.cpp # in place for this to work. (Sorry, it's braindeaded-level automation.) # If cpp_static_lib has been included it builds a statically-linked binary # named "FOO" from FOO.o and $(THISLIB_STATIC). # If cpp_dynamic_lib has been included it builds a dynamically-linked binary # "FOO_dynamic" from FOO.o and $(THISLIB_SHARED). # (This FOO_dynamic naming convention will change - i don't like it.) # todo: need better way of handling name descrepancy between static and dyn-linked bins. libtests: $(THISLIB_TESTS) submakes: $(THISLIB_TESTS) SUBMAKE_SOURCES = $(patsubst %,%.cpp,$(THISLIB_TESTS)) DIST_FILES += $(SUBMAKE_SOURCES) SUBMAKE_OBJECTS += $(patsubst %,%.o,$(THISLIB_TESTS)) SUBMAKE_COMMON_DEPS += Makefile $(THISLIB_STATIC) ifneq ($(THISLIB_STATIC),) # shared? CLEAN_FILES += $(THISLIB_TESTS) $(patsubst %,%.o,$(THISLIB_TESTS)) endif ifneq ($(THISLIB_SHARED),) # shared? CLEAN_FILES += $(patsubst %,%_dynamic,$(THISLIB_TESTS)) $(patsubst %,%_dynamic.o,$(THISLIB_TESTS)) endif #fore_namexform = $(patsubst .,_,$(1)) #foreach(fore_namexform,$(THISLIB_TESTS), # LDFLAGS += -export-dynamic call_linkmessage = echo '$(1) linking binary: $(3)' $(THISLIB_TESTS): $(SUBMAKE_COMMON_DEPS) $(SUBMAKE_OBJECTS) ifneq ($(THISLIB_STATIC),) # static? @$(call call_linkmessage,Statically,$@,$@) $(CXX) $(LDFLAGS) -o $@ $@.o $(THISLIB_STATIC) $(THISLIB_EXTRAOBJECTS) -lstdc++ # note that the order of the libs here is significant :/ endif # build shared versions? ifneq ($(THISLIB_SHARED),) # shared? @$(call call_linkmessage,Dynamically,$@,$(@)_dynamic) $(CXX) $(LDFLAGS) -export-dynamic -o $(@)_dynamic $@.o $(THISLIB_SHARED) $(THISLIB_EXTRAOBJECTS) -lstdc++ endif # build shared versions? # Note that the above usage of $(LDFLAGS) is not known to be valid. :/ It works in my # extremely simple cases. runtests: # does not account for dyn-linked bins... @for t in $(THISLIB_TESTS); do echo "Running $t..."; ./$$t || exit $$?; done --- NEW FILE: install.make --- # deprecated file. It's replacement is: include $(TOC_MAKESDIR)/INSTALL_XXX.make --- NEW FILE: install.380.make --- # these rules only work with GNU Make 3.80 and higher... # #!/bin/make -f # To be included from the shared toc makefile. REQUIRES GNU install. # # Sample usage: # INSTALL_BINS = mybin myotherbin # installs to $(prefix)/bin # INSTALL_LIBS = mylib.a myotherlib.a # installs to $(prefix)/lib # # There's a whole lot more to know, if you wanna poke around the code. # # Design note: the traditional xxx-local targets aren't really # necessary. If someone wants to customize install they can simply do # this: # # install: my-install # my-install: # .... # # # For each X in $(TOC_INSTALL_TARGET_BASENAMES) the following targets # are created: # # install-X: # uninstall-X: # install-X-symlink: # # Files will be installed to $(INSTALL_X_DEST) using install # arguments $(INSTALL_X_INSTALL_FLAGS). All of these vars are # set up by default, but may be customized: # # INSTALL_BINS_DEST = $(prefix)/$(PACKAGE_NAME)/bin # INSTALL_BINS_INSTALL_FLAGS = --mode=0775 # # # Installation can be further customized by using the toc_make_xxx # call()able functions. TOC_INSTALL_TARGET_BASENAMES = BINS SBINS LIBS PACKAGE_LIBS LIBEXECS HEADERS PACKAGE_HEADERS PACKAGE_DATA DOCS ifeq (,$(wildcard $(GNUINSTALL_BIN))) $(error install.make requires that the variable GNUINSTALL_BIN point to GNU install.) endif # This whole echo/grep thing is to force it to work on some of my # older machines where more sane approaches don't seem to work. TOC_MAKE_INSTALL_GREP_KLUDGE = test $(shell echo $(1) "" | grep -q '[a-zA-Z0-9]'; echo $$?) = 0 || exit 0 # toc_make_install call()able: # $1=file list, $2=destdir, $3=flags for $(GNUINSTALL_BIN) toc_make_install = $(call TOC_MAKE_INSTALL_GREP_KLUDGE,$(1)); \ test -d $(2) || mkdir -p $(2) || exit; \ for b in $(1) ""; do test -z "$$b" && continue; \ b=$$(basename $$b); \ target=$(2)/$$b; \ cmp $$target $$b > /dev/null 2>&1 && continue; \ cmd="$(GNUINSTALL_BIN) $(3) $$b $$target"; echo $$cmd; $$cmd || exit; \ done # toc_make_uninstall call()able: # removes all files listed in $(1) from target directory $(2) toc_make_uninstall = $(call TOC_MAKE_INSTALL_GREP_KLUDGE,$(1)); \ test -e "$(2)" || exit 0; \ for b in $(1) ""; do test -z "$$b" && continue; \ fp="$(2)/$$b"; test -e "$$fp" || continue; \ cmd="rm $$fp"; echo $$cmd; $$cmd || exit $$?; \ done # toc_make_install_symlink call()able: # works similarly to toc_make_install, but symlinks back to the install source, # instead of copying. Arg $3 is ignored. # Note that symlinks must be linked to absolute paths here, because we cannot # easily/reliably make a relative path from the target directory back to # the install source: toc_make_install_symlink = $(call TOC_MAKE_INSTALL_GREP_KLUDGE,$(1)); \ test -d $(2) || mkdir -p $(2) || exit; \ for b in $(1) ""; do test -z "$$b" && continue; \ target=$(2)/$$b; \ test $$target -ef $$b && continue; \ echo "Symlinking $$target"; ln -s -f $$PWD/$$b $$target || exit $$?; \ done # toc_make_install_so: installs foo.so.X.Y.Z and symlinks foo.so, foo.so.X and foo.so.Y to it, # in traditional/common Unix style. # $1 = so name (foo.so) # $2-4 = Major, Minor, Patch version numbers # $5 = destination directory toc_make_install_so = $(call TOC_MAKE_INSTALL_GREP_KLUDGE,$(1)); \ test -d $(5) || mkdir -p $(5) || exit; \ wholename=$(1).$(2).$(3).$(4); \ target=$(5)/$$wholename; \ test $$wholename -ef $$target || { \ echo "Installing/symlinking $$target"; \ cmd="$(GNUINSTALL_BIN) -s $$wholename $$target"; \ $$cmd || exit; \ }; \ cd $(5); \ for i in $(1) $(1).$(2) $(1).$(2).$(3); do \ test -e $$i && rm $$i; \ cmd="ln -fs $$wholename $$i"; echo $$cmd; \ $$cmd || exit; \ done # symlinking method number 2: # { set -x; \ # ln -fs $(1).$(2).$(3).$(4) $(1).$(2).$(3); \ # ln -fs $(1).$(2).$(3) $(1).$(2); \ # ln -fs $(1).$(2) $(1); \ # } GNUINSTALL_FLAGS_NONBINS = --mode=0644 GNUINSTALL_FLAGS_BINS = -s define INSTALL_MAKE_VARS_TEMPLATE INSTALL_$(1)_DEST ?= $$(prefix)/$(2) INSTALL_$(1)_INSTALL_FLAGS ?= $(3) endef # set up the initial install locations and install flags: $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,BINS,bin,$(GNUINSTALL_FLAGS_BINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,SBINS,sbin,$(GNUINSTALL_FLAGS_BINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,LIBS,lib,$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,PACKAGE_LIBS,lib/$(PACKAGE_NAME),$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,LIBEXECS,libexec,$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,HEADERS,include,$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,PACKAGE_HEADERS,include/$(PACKAGE_NAME),$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,PACKAGE_DATA,share/$(PACKAGE_NAME),$(GNUINSTALL_FLAGS_NONBINS))) $(eval $(call INSTALL_MAKE_VARS_TEMPLATE,DOCS,share/doc/$(PACKAGE_NAME),$(GNUINSTALL_FLAGS_NONBINS))) define INSTALL_MAKE_INSTALL_TARGETS install-$(1):;\ @$$(call toc_make_install,$$(INSTALL_$(1)),$$(INSTALL_$(1)_DEST),$$(INSTALL_$(1)_INSTALL_FLAGS)) endef $(foreach foo,$(TOC_INSTALL_TARGET_BASENAMES),$(eval $(call INSTALL_MAKE_INSTALL_TARGETS,$(foo)))) define INSTALL_MAKE_UNINSTALL_TARGETS uninstall-$(1):;\ @$$(call toc_make_uninstall,$$(INSTALL_$(1)),$$(INSTALL_$(1)_DEST)) endef $(foreach foo,$(TOC_INSTALL_TARGET_BASENAMES),$(eval $(call INSTALL_MAKE_UNINSTALL_TARGETS,$(foo)))) define INSTALL_MAKE_INSTALL_SYMLINK_TARGETS install-$(1)-symlink:;\ @$$(call toc_make_install_symlink,$$(INSTALL_$(1)),$$(INSTALL_$(1)_DEST)) endef $(foreach foo,$(TOC_INSTALL_TARGET_BASENAMES),$(eval $(call INSTALL_MAKE_INSTALL_SYMLINK_TARGETS,$(foo)))) install_targets = $(TOC_INSTALL_TARGET_BASENAMES) subdirs install: $(patsubst %,install-%,$(install_targets)) uninstall: $(patsubst %,uninstall-%,$(install_targets)) install-symlink: $(patsubst %,install-%-symlink,$(install_targets)) install-bins: install-BINS uninstall-bins: uninstall-BINS install-sbins: install-SBINS uninstall-sbins: uninstall-SBINS install-libs: install-LIBS uninstall-libs: uninstall-LIBS install-libexecs: install-LIBEXECS uninstall-libexecs: uninstall-LIBEXECS install-pkgdata: install-PACKAGE_DATA uninstall-pkgdata: uninstall-PACKAGE_DATA install-headers: install-HEADERS uninstall-headers: uninstall-HEADERS install-pkgheaders: install-PACKAGE_HEADERS uninstall-pkgheaders: install-PACKAGE_HEADERS install-docs: install-DOCS uninstall-docs: uninstall-DOCS install-subdirs: @$(call toc_make_subdirs,$(SUBDIRS),install) install-subdirs-symlink: @$(call toc_make_subdirs,$(SUBDIRS),install-symlink) uninstall-subdirs: @$(call toc_make_subdirs,$(SUBDIRS),uninstall) --- NEW FILE: makerules.QT_MOC_DEPS --- #!/bin/bash # Generates makefile dependencies for files in $PWD which look like # they are mocable. This does not create any rules for actually # creating moc files. # # Usage: # $0 [moc_prefix] # where moc_prefix defaults to 'moc_', and is used to name # output files. MOC_PRE=${1-moc_} ARGS="$@" headers=$(ls *.h *.hpp *.hxx 2>/dev/null) test x = "x$headers" && exit 0 cat <<EOF ############################################################ # moc dependency rules generated by: # $0 $@ EOF for H in ${headers}; do if ! grep -l "Q_OBJECT" $H &>/dev/null; then continue fi base=${H%%.h*} base=${base##${MOC_PRE}} mocbase="${MOC_PRE}${base}" mocpp="${mocbase}.cpp" mocobj="${mocbase}.o" echo "${mocpp}: ${H}" echo "${mocobj}: ${mocpp}" echo "CLEAN_FILES += ${mocpp} ${mocobj}" done cat <<EOF # end moc dependency rules. ############################################################ EOF --- NEW FILE: QT_MOC_DEPS.make --- # This is out-moded. Don't use it. # # manages moc file dependencies and compiling for Qt moc sources. # # Usage: # include $(TOC_MAKESDIR)/qt_moc.make # # Effects: # - $(MOC_PREFIX)*.* are managed for you (deps, compiling MOC_PREFIX = moc_ QT_MOC_MAKEFILE = $(TOC_MAKESDIR)/qt_moc.make QT_MOC_DEPSFILE = .toc.QT_MOC_DEPS.make $(MOC_PREFIX)%.cpp: @in=$@; in=$${in%%.cpp}.h; in=$${in##$(MOC_PREFIX)}; \ cmd="$(MOC) $$in -o $@"; echo $$cmd; $$cmd QT_MOC_RULESGEN = $(TOC_MAKESDIR)/makerules.QT_MOC_DEPS QT_MOC_DEPS: $(QT_MOC_DEPSFILE) $(QT_MOC_DEPSFILE): Makefile $(wildcard *.h *.hpp *.hxx) $(QT_MOC_RULESGEN) ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping moc file dependencies generation." else @echo "Generating moc file dependencies..."; \ $(QT_MOC_RULESGEN) $(MOC_PREFIX) > $@ endif -include $(QT_MOC_DEPSFILE) deps: QT_MOC_DEPS mocs: QT_MOC_DEPS $(QT_MOC_OUT_SOURCES) all: QT_MOC_DEPS --- NEW FILE: TARBALL.make --- #!/do/not/make # # a toc snippet to help provide support for creating tarballs. # It expects $(TAR_BIN) to be set via the configure process (e.g., via the # gnu_tar test). # # Define: # # TARBALL_TARGETS = target1 [...targetN] # optional: TARBALL_FLAGS = flags to pass to tar (e.g., -z for gzip) # optional: TARBALL_CHDIR = [path to cd to before starting] # # For each target in TARBALL_TARGETS you must define the following: # # target1_TARBALL_FILES = list of files/dirs to tar # target1_TARBALL = destination filename # optional: target1_TARBALL_FLAGS = takes precedence over TARBALL_FLAGS # optional: target1_TARBALL_CHDIR = [path to cd to before starting] # # xxx_TARBALL_CHDIR is an odd-case var, and is not required (it defaults # to .) # # To run all TARBALL targets run one of: # make TARBALL # # To run one of them: # make TARBALL-targetname TARBALL_MAKEFILE = $(TOC_MAKESDIR)/TARBALL.make ifeq (,$(TAR_BIN)) $(warning you must define TAR_BIN before using the TARBALL targets. Try running the gnu_tar toc test.) TARBALL: $(patsubst %,tar-%,$(TARBALL_TARGETS)): else TARBALL_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.TARBALL $(TARBALL_RULES_GENERATOR): $(TARBALL_MAKEFILE): TARBALL_INCFILE = .toc.TARBALL.make CLEAN_FILES += $(TARBALL_INCFILE) $(TARBALL_INCFILE): $(TARBALL_RULES_GENERATOR) $(TARBALL_MAKEFILE) Makefile ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping TARBALL rules generation." else @echo "Generating TARBALL rules."; \ $(call toc_generate_rules,TARBALL,$(TARBALL_TARGETS)) > $@ endif -include $(TARBALL_INCFILE) .PHONY: TARBALL TARBALL: endif # ^^^ end no-tar guard --- NEW FILE: makerules.LYX_EXPORT --- #!/bin/sh # For use in generating rules for LYX_EXPORT.make. test 0 = ${#@} && { echo "usage: $0 file1.lyx [... fileN.lyx]" exit 1 } thisapp="\$(TOC_MAKESDIR)/makerules.LYX_EXPORT" filters_makefile="\$(TOC_MAKESDIR)/LYX_EXPORT.make" cat <<EOF ############################## LYX_EXPORT rules: ifeq (,\$(LYX_BIN)) \$(error LYX_BIN must be set to the path to lyx!) endif LYX_EXPORT_FORMATS ?= html pdf EOF for t in "$@"; do echo "###################### ${t}_lyx:" cat <<EOF ${t}_lyx_FORMATS ?= \$(LYX_EXPORT_FORMATS) ${t}_lyx_EXPORT_ARGS ?= \$(LYX_EXPORT_ARGS) LYX_EXPORT-${t}: @for f in \$(${t}_lyx_FORMATS); do \\ echo "Exporting ${t}.lyx to ${t}.\$\$f..."; \\ \$(LYX_BIN) -e \$\$f ${t}.lyx \$(${t}_lyx_EXPORT_ARGS) >/dev/null || exit; \\ done .PHONY: LYX_EXPORT-${t} LYX_EXPORT: LYX_EXPORT-${t} CLEAN_FILES += \$(patsubst %,${t}.%,\$(${t}_lyx_EXPORT_FORMATS)) EOF done cat <<EOF # implement the LYX_EXPORT-post target to do post-export processing, # like renaming foo.XXX to foo-\$(PACKAGE_NAME).XXX. LYX_EXPORT-post: LYX_EXPORT: LYX_EXPORT-post EOF echo "############################## end LYX_EXPORT rules" --- NEW FILE: DOXYGEN.make --- #!/do/not/make # a (big) snippet to build API docs using doxygen # Much of this process was written by Rusty Ballinger. # # Edit the file Doxyfile template, Doxyfile.at, using # @at-token@ conventions. # # Define: # DOXYGEN_PREDEF = predfined C vars # DOXYGEN_ATPARSE_ARGS = list of args to pass to the @at-parser@ # Some globally-defined vars are pre-set. # In particular you may want to add: # DOXYGEN_INPUT="index.txt $(top_includesdir)/yourincludes)" # DOXYGEN_FILTER=/path/to/filter (may be left blank) # Useful sometimes for perl/sed'ing, e.g., C macros in API docs. # # Sample: # INCLUDES_DIRS = $(addprefix $(top_includesdir)/,lib1 otherlib) # # DOXYGEN_PREDEF = \ # HAVE_CONFIG_H=1 # # DOXYGEN_ATPARSE_ARGS = \ # DOXYGEN_INPUT="index.txt $(INCLUDES_DIRS)" # # Of course your Doxyfile.at must have the appropriate @tokens@ in it, # but the one shipped with this file is already set up for you. ifeq (,$(DOXYGEN_BIN)) $(error The variable DOXYGEN_BIN must be set before including this file.) endif DOXYFILE = Doxyfile DOXYGEN_HTML_OUTDIR ?= ./doxygen DOXYGEN_IN = Doxyfile.at DIST_FILES += $(DOXYGEN_IN) index.txt DOXYGEN_INSTALL_DIRNAME ?= doxygen-$(PACKAGE_NAME)-$(PACKAGE_VERSION) docs: doxygen clean: clean-doxygen install: install-doxygen DOXYGEN_ATPARSE_ARGS += \ top_srcdir="${top_srcdir}" \ top_libdir="${top_libdir}" \ top_includesdir="${top_includesdir}" \ PERL="$(PERL)" \ PACKAGE_NAME="$(PACKAGE_NAME)" \ PACKAGE_VERSION="$(PACKAGE_VERSION)" \ PREDEFINED="$(DOXYGEN_PREDEF)" \ DOXYGEN_FILTER="$(DOXYGEN_FILTER)" \ DOXYGEN_HTML_OUTDIR="$(DOXYGEN_HTML_OUTDIR)" DOXYGEN_MAKE = $(toc_makesdir)/DOXYGEN.make atparser = $(top_srcdir)/toc/bin/atsign_parse $(top_srcdir)/configure: $(DOXYFILE): $(DOXYGEN_FILTER) $(DOXYGEN_IN) Makefile $(top_srcdir)/configure @echo "Creating $@."; \ $(call toc_atparse_file,$(DOXYGEN_IN),$@, \ $(DOXYGEN_ATPARSE_ARGS) \ ) CLEAN_FILES += $(DOXYFILE) INSTALL_DEST_DOXYGEN = $(INSTALL_DOCS_DEST) DISTCLEAN_FILES += $(DOXYFILE) doxygen: clean-doxygen $(DOXYFILE) $(DOXYGEN_BIN) @echo HTML output is in $(DOXYGEN_HTML_OUTDIR). clean-doxygen: -rm -fr $(DOXYGEN_HTML_OUTDIR) latex doxygen_finaldest = $(INSTALL_DOCS_DEST)/$(DOXYGEN_INSTALL_DIRNAME) install-doxygen: doxygen @echo "Installing HTML docs to $(doxygen_finaldest)" @test -d $(doxygen_finaldest) && exit 0; rm -fr $(doxygen_finaldest) @test -d $(INSTALL_DOCS_DEST) && exit 0; mkdir -p $(INSTALL_DOCS_DEST) @cp -r $(DOXYGEN_HTML_OUTDIR) $(doxygen_finaldest) uninstall-doxygen: @echo "Uninstalling doxgen-generated docs: $(doxygen_finaldest)" @-test -d $(doxygen_finaldest) || exit 0; rm -fr $(doxygen_finaldest) uninstall: uninstall-doxygen # all: docs --- NEW FILE: toc.qmake.at --- # toc.qmake.at: template makefile for toc.qmake, part of the # toc build process. This is filtered at the end of the configure # process. toc.qmake may be included by your qmake files. # # many of the $$vars seen here come from toc.@PACKAGE_NAME@.make, # and all @TOKENS@ are replaced at configure-time. top_srcdir = @TOP_SRCDIR@ include( $$top_srcdir/toc.@PACKAGE_NAME@.configure.make ) QTDIR = @QTDIR@ QTBINDIR = @QTBINDIR@ QTINCDIR = @QTINCDIR@ QTLIBDIR = @QTLIBDIR@ # -lqt (or -lqt-mt?) if we have Qt, nothing if we don't. LQT = @LQT@ UIC = @UIC@ MOC = @MOC@ QMAKE = @QMAKE@ ############################ most of this comes from the gnu_cpp_tools toc test: CC = @CC@ INCLUDES += @INCLUDES@ # C preprocessor flags, used in compiling C & C++ files. CPPFLAGS += @CPPFLAGS@ CPPFLAGS += $$INCLUDES -DHAVE_CONFIG_H=1 # Optimization flags (-g or -On) used in compiling C & C++ files. OPT = @OPT@ # Warning flags (-Wall, -Werror, -woff, etc.) used in compiling C & C++ files. WARN = @WARN@ # C flags, used in compiling C files. Includes $$OPT and $$WARN. QMAKE_CFLAGS += @CFLAGS@ QMAKE_CFLAGS += $$OPT $$WARN # C++ flags, used in compiling C++ files. Includes $$OPT and $$WARN. QMAKE_CXXFLAGS += @CXXFLAGS@ QMAKE_CXXFLAGS += $$OPT $$WARN # ld flags, used in linking binaries. QMAKE_LFLAGS += @LDFLAGS@ ########################### include( $$top_srcdir/toc.@PACKAGE_NAME@.qmake ) --- NEW FILE: SHARED_LIBS.make --- # Links objects into a dynamically-linked library using $(CXX) # (only tested with g++). # # Usage: # # SHARED_LIBS = foo # SHARED_LIBS_OBJECTS = # optional list of .o files to link to all $(SHARED_LIBS) # foo_so_OBJECTS = list of object files to link to foo.so # foo_so_LDADD = # optional libraries passed to linker (e.g., -lstdc++) # foo_so_LDFLAGS = # optional args to linker # foo_so_VERSION = # optional Major.Minor.Patch # e.g. "1.0.1" it MUST match this format! # foo_so_INSTALL_DEST = # optional installation path. Defaults to $(INSTALL_LIBEXECS_DEST) # foo_so_INSTALL = 0 # optional: suppresses generation of installation rules. i.e., # foo.so will not be installed. # include $(TOC_MAKESDIR)/SHARED_LIBS.make # # If foo_so_VERSION is not set then 0.0.0 is assumed. # # Run: # all: SHARED_LIBS # # Effect: # Creates foo.so and foo.so<version> by linking $(foo_so_OBJECTS). It # also sets up install/uninstall rules for handling the symlinks. SHARED_LIBS_MAKEFILE = $(TOC_MAKESDIR)/SHARED_LIBS.make ######################################################################## # toc_link_shared_lib call()able function # $1 = basename # $2 = extra args for the linker toc_link_shared_lib = { soname=$(1).so; wholename=$${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR).$($(1)_so_PATCH); \ stamp=$${soname}.$($(1)_so_MAJOR); \ test x = "x$($(1)_so_MAJOR)" && { wholename=$${soname}; stamp=$(1).so;}; \ cmd="$(CXX) $(CXXFLAGS) $(LDFLAGS) $($(1)_LDFLAGS) -o $${wholename} -rdynamic -shared \ -Wl,-soname,$${stamp} $($(1)_so_OBJECTS) $(SHARED_LIBS_OBJECTS) $(SHARED_LIBS_LDADD) $($(1)_so_LDADD) $(2)"; \ test x = "x$(CCDV_BIN)" && echo $$cmd; \ $$cmd || exit; \ test x = "x$($(1)_so_MAJOR)" || { \ ln -fs $${wholename} $${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR); \ ln -fs $${wholename} $${soname}.$($(1)_so_MAJOR); \ ln -fs $${wholename} $${soname}; \ }; \ } # symlinking methods: # method 1: # ln -fs $${wholename} $${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR); \ # ln -fs $${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR) $${soname}.$($(1)_so_MAJOR); \ # ln -fs $${soname}.$($(1)_so_MAJOR) $${soname}; \ # method 1.5: # link1=$${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR); ln -fs $${wholename} $$link1; \ # link2=$${soname}.$($(1)_so_MAJOR); ln -fs $$link1 $$link2; \ # link3=$${soname}; ln -fs $$link2 $$link3; \ # method 2: # ln -fs $${wholename} $${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR); \ # ln -fs $${wholename} $${soname}.$($(1)_so_MAJOR); \ # ln -fs $${wholename} $${soname}; \ # for l in $${soname} \ # $${soname}.$($(1)_so_MAJOR) \ # $${soname}.$($(1)_so_MAJOR).$($(1)_so_MINOR) \ # ; do \ # ln -fs $${wholename} $$l; \ # done; \ ifneq ($(SHARED_LIBS),) SHARED_LIBS_SOFILES = $(patsubst %,%.so,$(SHARED_LIBS)) SHARED_LIBS_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.SHARED_LIBS # to ensure that .so files are installed in a unix-friendly manner we need to implement # some install rules for them... SHARED_LIBS_DEPSFILE = .toc.SHARED_LIBS.make deps: $(SHARED_LIBS_INSTALL_RULES) $(SHARED_LIBS_DEPSFILE): Makefile $(SHARED_LIBS_MAKEFILE) $(SHARED_LIBS_RULES_GENERATOR) ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping SHARED_LIBS rules generation." else @echo "Generating SHARED_LIBS rules."; \ $(call toc_generate_rules,SHARED_LIBS,$(SHARED_LIBS)) > $@ endif -include $(SHARED_LIBS_DEPSFILE) CLEAN_FILES += $(SHARED_LIBS_SOFILES) $(wildcard $(patsubst %,%.*,$(SHARED_LIBS_SOFILES))) libs: SHARED_LIBS endif # ^^^ got SHARED_LIBS? --- NEW FILE: LYX_EXPORT.make --- #!/do/not/make # # A toc Makefile snippet to export input files using LyX (http://www.lyx.org). # # Usage: # # LYX_EXPORT = mylyxfile myotherfile ... (WITHOUT file extensions) # LYX_EXPORT_FORMATS = format list, as expected by 'lyx -e XXX'. Defaults to 'html pdf'. # LYX_EXPORT_ARGS = optional args to pass to lyx # # optional: mylyxfile_lyx_FORMATS = defaults to LYX_EXPORT_FORMATS # # optional: mylyxfile_lyx_EXPORT_ARGS = defaults to LYX_EXPORT_ARGS # include $(TOC_MAKESDIR)/LYX_EXPORT.make # # all: LYX_EXPORT # # Requires: # LYX_BIN = /path/to/lyx # Any exporters which lyx may need. LYX_EXPORT_MAKE = $(TOC_MAKESDIR)/LYX_EXPORT.make LYX_EXPORT_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.LYX_EXPORT LYX_EXPORT_INCFILE = .toc.LYX_EXPORT.make CLEAN_FILES += $(LYX_EXPORT_INCFILE) $(LYX_EXPORT_INCFILE): $(LYX_EXPORT_RULES_GENERATOR) $(LYX_EXPORT_MAKE) Makefile ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping LYX_EXPORT rules generation." else @echo "Generating LYX_EXPORT rules."; \ $(call toc_generate_rules,LYX_EXPORT,$(LYX_EXPORT)) > $@ endif -include $(LYX_EXPORT_INCFILE) .PHONY: LYX_EXPORT LYX_EXPORT: lyx: LYX_EXPORT --- NEW FILE: INSTALL_XXX.make --- #!/do/not/make # # To be included from the shared toc makefile. # Creates un/install rules for sets of files. # # Sample usage: # INSTALL_BINS = mybin myotherbin # installs to $(prefix)/bin # INSTALL_LIBS = mylib.a myotherlib.a # installs to $(prefix)/lib # # There's a *whole lot* more to know, if you wanna poke around the code. # # Design note: the traditional xxx-local targets aren't really # necessary. If someone wants to customize install they can simply do # this: # # install: my-install # my-install: # .... # # # For each X in (some list you can find in this makefile) it # creates the following targets are created: # # install-X: # uninstall-X: # install-X-symlink: # # Files will be installed to $(INSTALL_X_DEST) using install # arguments $(INSTALL_X_INSTALL_FLAGS). All of these vars are # set up by default, but may be customized: # # INSTALL_X_DEST = $(prefix)/$(PACKAGE_NAME)/bin # INSTALL_X_INSTALL_FLAGS = -m 0775 # # To add new installation groups to this file do the following: # # - Add an MYNEWGROUP='install/path' entry to the var INSTALL_XXX_PATHS. # # - Add INSTALL_MYNEWGROUP_INSTALL_FLAGS var, following the conventions # set by the other ...INSTALL_FLAGS vars in this file. # # Installation can be further customized by using the toc_make_xxx # call()able functions defined below... # ######################################################################## ifeq (,$(wildcard $(INSTALLER_BIN))) $(error INSTALL_XXX.make requires that the variable INSTALLER_BIN point to a version of install which is vaguely compatible with GNU install. \ Normally it will be set by the toc_core_tests configure test.) endif #INSTALL_BINS_SUFFIX ?= #ifeq (1,$(configure_with_CYGWIN)) #INSTALL_BINS_SUFFIX = .exe #endif ############################################################ # toc_make_install call()able: # $1=file list # $2=destdir. The global $(DESTDIR) is prepended to it # $3=flags for $(INSTALLER_BIN) toc_make_install = test "x$(1)" = x && exit 0; \ dest="$(DESTDIR)$(2)"; \ test -d "$$dest" || mkdir -p "$$dest" || exit; \ for b in $(1) "x"; do test "x$$b" = "xx" && break; \ b=$$(basename $$b); \ target="$$dest/$$b"; \ cmd="$(INSTALLER_BIN) $(3) $$b $$target"; echo $$cmd; $$cmd || exit; \ done ############################################################ # toc_make_install_update: identical to toc_make_install # but does not update the target if it is the same as the source. toc_make_install_update = test x = "x$(1)" && exit 0; \ dest="$(DESTDIR)$(2)"; \ test -d "$$dest" || mkdir -p "$$dest" || exit; \ for b in $(1) ""; do test -z "$$b" && continue; \ b="$$(basename $$b)"; \ target="$$dest/$$b"; \ cmp "$$target" "$$b" > /dev/null 2>&1 && continue; \ cmd="$(INSTALLER_BIN) $(3) $$b $$target"; echo "$$cmd"; $$cmd || exit; \ done ############################################################ # toc_make_uninstall call()able: # removes all files listed in $(1) from target directory $(2) toc_make_uninstall = test "x$(1)" = x && exit 0; \ dest="$(DESTDIR)$(2)"; \ test -e "$$dest" || exit 0; \ for b in $(1) ""; do test -z "$$b" && continue; \ fp="$$dest/$$b"; test -e "$$fp" || continue; \ cmd="rm $$fp"; echo $$cmd; $$cmd || exit $$?; \ done ############################################################ # toc_make_install_symlink call()able: # Works similarly to toc_make_install, but symlinks back to the install source, # instead of copying. Arg $3 is ignored. # Note that symlinks must be linked to absolute paths here, because we cannot # easily/reliably make a relative path from the target directory back to # the install source: toc_make_install_symlink = test "x$(1)" = x && exit 0; \ dest="$(DESTDIR)$(2)"; \ test -d "$$dest" || mkdir -p "$$dest" || exit; \ for b in $(1) ""; do test -z "$$b" && continue; \ target="$$dest/$$b"; \ pwd="$$(pwd)"; \ src="$$pwd/$$b"; \ test "$$target" -ef "$$src" && continue; \ test -f "$$target" && rm "$$target"; \ echo "Symlinking $$target"; ln -s -f "$$src" "$$target" || exit $$?; \ done ############################################################ # toc_make_install_so: installs foo.so.X.Y.Z and symlinks foo.so, foo.so.X and foo.so.X.Y to it, # in traditional/common Unix style. # $1 = so name (foo.so) # $2-4 = Major, Minor, Patch version numbers # $5 = destination directory toc_make_install_so = test "x$(1)" = x && exit 0; \ dest="$(DESTDIR)$(5)"; \ test -d "$$dest" || mkdir -p "$$dest" || exit; \ wholename=$(1).$(2).$(3).$(4); \ target="$$dest"/$$wholename; \ test $$wholename -ef $$target || { \ echo "Installing/symlinking $$target"; \ cmd="$(INSTALLER_BIN) -m 0755 $$wholename $$target"; \ $$cmd || exit; \ }; \ cd "$$dest"; \ for i in $(1) $(1).$(2) $(1).$(2).$(3); do \ test -e $$i && rm $$i; \ cmd="ln -fs $$wholename $$i"; echo $$cmd; \ $$cmd || exit; \ done # symlinking method number 2: # { set -x; \ # ln -fs $(1).$(2).$(3).$(4) $(1).$(2).$(3); \ # ln -fs $(1).$(2).$(3) $(1).$(2); \ # ln -fs $(1).$(2) $(1); \ # } ############# some phony targets... .PHONY: install-. uninstall-. subdirs-install: # implemented elsewhere install: install-. install-subdirs install-update: install-.-update install-subdirs-update install-symlink: install-.-symlink install-subdirs-symlink install-subdirs: subdirs-install install-subdirs-symlink: subdirs-install-symlink install-subdirs-update: subdirs-install-update uninstall-subdirs: subdirs-uninstall uninstall: uninstall-. uninstall-subdirs # implement these to hook in to the start of the install. Untested. :/ install-.: install-.-update: install-.-symlink: uninstall-.: ############# TOC_INSTALL_TARGET_BASENAMES += BINS SBINS LIBS PACKAGE_LIBS LIBEXECS HEADERS PACKAGE_HEADERS PACKAGE_DATA DOCS \ ############ internal shortcuts: INSTALLER_BIN_FLAGS_BINS = -m 0755 INSTALLER_BIN_FLAGS_NONBINS = -m 0644 INSTALLER_BIN_FLAGS_LIBS = -m 0644 INSTALLER_BIN_FLAGS_LIBEXECS = -m 0755 ########### ################# default install flags for the installable file categories: INSTALL_BINS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_BINS) INSTALL_SBINS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_BINS) INSTALL_LIBS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_LIBS) INSTALL_PACKAGE_LIBS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_LIBS) INSTALL_LIBEXECS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_LIBEXECS) INSTALL_HEADERS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_PACKAGE_HEADERS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_PACKAGE_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_DOCS_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN1_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN2_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN3_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN4_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN5_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN6_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN7_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_MAN8_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) INSTALL_PKGCONFIG_INSTALL_FLAGS ?= $(INSTALLER_BIN_FLAGS_NONBINS) ################# ######################################################################## # installation paths, in the format expected by makerules.INSTALL_XXX # They should be relative to ${prefix}. INSTALL_XXX_PATHS += \ BINS=bin \ SBINS=sbin \ LIBS=lib \ PACKAGE_LIBS='lib/$(PACKAGE_NAME)' \ LIBEXECS=lib \ HEADERS=include \ PACKAGE_HEADERS='include/$(PACKAGE_NAME)' \ PACKAGE_DATA='share/$(PACKAGE_NAME)' \ DOCS='share/doc/$(PACKAGE_NAME)' \ MAN1='share/man/man1' \ MAN2='share/man/man2' \ MAN3='share/man/man3' \ MAN4='share/man/man4' \ MAN5='share/man/man5' \ MAN6='share/man/man6' \ MAN7='share/man/man7' \ MAN8='share/man/man8' \ PKGCONFIG='lib/pkgconfig' # INSTALL_XXX_PATHSNotes: # # - LIBEXECS=lib is intentional: i figure that since there is no /usr/libexec # nor /libexec, the traditional usage of LIBEXEC is probably "broken". # # - PKGCONFIG is data files for the pkg-config tool. ######################################################################## ################ Internal use: # Set install paths for the installable file categories # and create installation rules. With make 3.80 we can do this with $(eval), # Make 3.79 is very common, but doesn't support $(eval). INSTALL_MAKEFILE = $(TOC_MAKESDIR)/INSTALL_XXX.make INSTALL_RULES_FILE = $(top_srcdir)/.toc.INSTALL_XXX.make INSTALL_XXX_GENERATOR = $(TOC_MAKESDIR)/makerules.INSTALL_XXX $(INSTALL_RULES_FILE): $(INSTALL_MAKEFILE) $(INSTALL_XXX_GENERATOR) ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping INSTALL_XXX rules generation." else @echo "Generating rules for INSTALL_XXX."; \ $(call toc_generate_rules,INSTALL_XXX,\ $(INSTALL_XXX_PATHS) \ ) > $@ endif -include $(INSTALL_RULES_FILE) deps: $(INSTALL_RULES_FILE) ################# --- NEW FILE: makerules.QMAKE2MAKE --- #!/bin/bash # Creates some makefile code for the $(QMAKE2MAKE) var. # Intended for use with QMAKE2MAKE.make make_pre="make." # prefix for generated makefiles qmake_suf=".qmake" # suffix for input qmake files. test -z "$1" && { echo "usage: $0 qmakefile1 [qmakefile2 ...]" echo "Pass the names of *${qmake_suf} files, without the ${qmake_suf} extension." exit 1 } cat <<EOF ######################################################################## # Automatically generated QMAKE2MAKE rules: # $0 $@ EOF for q in $@; do qmf="${make_pre}${q}" qpro="${q}${qmake_suf}" if test ! -e ${qpro}; then echo "$0: The qmake file '${qpro}' does not exist. " \ "Create it or remove '${q}' from your QMAKE2MAKE variable." 1>&2 exit 2 fi cat <<EOF ${qmf}: ${qpro} $0 @cmd="\$(QMAKE) -o \$@ ${qpro}"; echo \$\$cmd; \$\$cmd qmake-${q}: \${MAKE} -f ${qmf} EOF for p in install uninstall first clean distclean staticlib mocables; do # echo "${p}:" qtgt="qmake-${q}-${p}" echo "${qtgt}: ${qmf}" echo -e "\t@echo \"Making target '${p}' in ${qmf}...\";" echo -e "\t\${MAKE} -f ${qmf} ${p}" if test "$p" = "distclean"; then echo -e "\t-rm ${qmf}" fi echo "${p}: ${qtgt}" done echo "qmake-all: qmake-${q}" done cat <<EOF # End QMAKE2MAKE rules for: $@ ######################################################################## EOF --- NEW FILE: headers_symlinks.make --- # Makefile snippet to create symlinks. # # sample usage: # default: all # HEADERS_SYMLINKS = $(wildcard somedir/*.h) # include path/to/this_file # all: links $(HEADERS_SYMLINKS): @test -e `basename $@` && exit 0; \ link="ln -s $@ ."; \ echo $$link; \ $$link || echo "link failed!" .PHONY: headers_links $(HEADERS_SYMLINKS) headers_symlinks: $(HEADERS_SYMLINKS) --- NEW FILE: RSYNC.make --- #!/do/not/make # # a toc snippet to help provide support for uploading stuff over rsync. # It expects $(RSYNC_BIN) to be set via the configure process. # # Author: stephan - sg...@us... # # Usage: # # Define: # # RSYNC_TARGETS = target1 [...targetN] # optional: RSYNC_FLAGS = flags to pass to scp, like -C to enable compression # optional: RSYNC_DEST = [user@remote:]/destination/path # optional: RSYNC_CHDIR = [path to cd to before starting] # # For each target in SCP_TARGETS you must define the following: # # target1_RSYNC_FILES = list of files/dirs to rsync # optional: target1_RSYNC_DEST = [user@remote:]/destination/path # optional: target1_RSYNC_FLAGS = takes precedence over RSYNC_FLAGS # optional: target1_RSYNC_CHDIR = [path to cd to before starting] # # xxx_RSYNC_CHDIR is an odd-case var, and is not required (it defaults # to .) # # At least one of RSYNC_DEST or target_RSYNC_DEST must be set, # and the target_RSYNC_DEST takes precedence. # # To run all RSYNC targets run one of: # make RSYNC # make rsync # # To run one of them: # make RSYNC-targetname # make rsync-targetname # RSYNC_MAKEFILE = $(TOC_MAKESDIR)/RSYNC.make ifeq (,$(RSYNC_BIN)) $(warning you must define RSYNC_BIN before using the RSYNC targets. Try running the rsync toc test.) RSYNC: $(patsubst %,rsync-%,$(RSYNC_TARGETS)): $(patsubst %,RSYNC-%,$(RSYNC_TARGETS)): else RSYNC_RULES_GENERATOR = $(TOC_MAKESDIR)/makerules.RSYNC $(RSYNC_RULES_GENERATOR): $(RSYNC_MAKEFILE): RSYNC_INCFILE = .toc.RSYNC.make CLEAN_FILES += $(RSYNC_INCFILE) $(RSYNC_INCFILE): $(RSYNC_RULES_GENERATOR) $(RSYNC_MAKEFILE) Makefile ifeq (1,$(MAKING_CLEAN)) @echo "$(MAKECMDGOALS): skipping RSYNC rules generation." else @echo "Generating RSYNC rules."; ... [truncated message content] |