# Generalised Makefile.in # # Copyright 2001,2004 Hugo Mills # # Based on ideas found in the paper "Recursive Make Considered # Harmful" (1997) Peter Miller # A list of modules to build MODULES := plugins plugins/content_outline @MAPTOOLS@ # File sources & objects (added to by each module) SRC := magellan.cc \ include/magellan/xfview.h xfview.cc \ include/magellan/xfmap.h \ include/magellan/xforbit.h xforbit.cc \ include/magellan/xfsphere.h xfsphere.cc \ include/magellan/output.h output.cc \ include/magellan/configuration.h configuration.cc \ parser_config.cc \ include/magellan/configlexer.h configlexer.cc \ include/magellan/parsertools.h parsertools.cc \ include/magellan/options.h options.cc \ contentgroup.h contentgroup.cc \ include/magellan/contentfilled.h contentfilled.cc \ mdisplay.h mdisplay.cc \ rendercontext.h rendercontext.cc \ rendercontextstacked.h rendercontextstacked.cc \ plugins.h plugins.cc \ plugininfo_contentgroup.h \ plugininfo_display.h \ include/magellan/plugininfo_viewport.h \ include/magellan/plugin.h plugin.cc \ include/magellan/content.h \ include/magellan/output.h \ include/magellan/parsertools.h \ include/magellan/plugin.h \ include/magellan/plugininfo.h \ include/magellan/plugininfo_content.h \ include/magellan/plugininfo_map.h \ include/magellan/plugininfo_orbit.h \ include/magellan/plugininfo_output.h \ include/magellan/values.h \ include/magellan/vectors.h \ ifneq ("@BOOST_CPPFLAGS@","") SRC += renderer.h renderer.cc endif DOC_DIST := doc/notes.txt doc/programmers-reference.txt \ doc/examples/all-projections \ # Files to install, in various directories (added to by each module) INSTALL_BIN := magellan INSTALL_SBIN := INSTALL_LOCALSTATE := INSTALL_LIB := # Targets to make (added to by each module) TARGETS := magellan # Other things to distribute SRC_DIST := $(SRC) EXTRA_DIST := ############################### # Modify above this line only # ############################### ### # Make everything all: targets ### # Include the makefiles for each module MAKEFILES = $(patsubst %,%/Makefile.mk,$(MODULES)) include $(MAKEFILES) # Work out the full list of object files (C and C++ only here) OBJS := $(patsubst %.c,%.o,$(filter %.c,$(SRC))) \ $(patsubst %.cc,%.o,$(filter %.cc,$(SRC))) ### # Tools CXX:=@CXX@ CC:=@CC@ INSTALL:=@INSTALL@ TAR:=@TAR@ COMPRESS:=@COMPRESS@ LIBTOOL:=libtool # -pg -fprofile-arcs CFLAGS:=@CFLAGS@ CXXFLAGS:=@CXXFLAGS@ -I. -I./include -DDEBUG -g -O0 -rdynamic @BOOST_CPPFLAGS@ LIBS:=@LIBS@ -L/usr/local/lib @BOOST_LDFLAGS@ @BOOST_THREAD_LIB@ SHLIB:=-ldl SOFLAGS:=-fPIC -shared ### # Directories exec_prefix=@exec_prefix@ prefix=@prefix@ ### # All targets targets: config.status config.h $(MAKEFILES) $(TARGETS) POS := @localstatedir@ magellan: $(OBJS) $(CXX) $(CXXFLAGS) $(SHLIB) $(LIBS) -o magellan $(OBJS) ### # Clean things up clean: find . \( -name \*~ \ -o -name \*.o \ -o -name \*.d \ -o -name \*.lo \ -o -name core \) \ -exec rm -f \{\} \; rm -f $(TARGETS) realclean: clean find . \( -name \*.d \ -o -name .libs \) \ -exec rm -f \{\} \; ### # Dependency generation include $(filter %.d,$(OBJS:.o=.d)) test: echo $(OBJS) %.d: %.cc ./mkdepend $< $(CXX) $(dir $<) $(CXXFLAGS) >$@ %.d: %.c ./mkdepend $< $(CC) $(dir $<) $(CFLAGS) >$@ ### # Installation of files install: install_bin install_sbin install_lib install_local install-data: install_data install_bin: $(INSTALL_BIN) mkdir -p @bindir@ ; \ if test ! -z "$(INSTALL_BIN)"; then \ $(INSTALL) -s $(INSTALL_BIN) @bindir@ ; \ fi install_sbin: $(INSTALL_SBIN) mkdir -p @sbindir@ ; \ if test ! -z "$(INSTALL_SBIN)"; then \ $(INSTALL) -s $(INSTALL_SBIN) @sbindir@ ; \ fi install_lib: $(INSTALL_LIB) mkdir -p @libdir@/magellan/plugins ; \ if test ! -z "$(INSTALL_LIB)"; then \ $(INSTALL) -s $(INSTALL_LIB) @libdir@/magellan/plugins ; \ fi install_local: $(INSTALL_LOCALSTATE) mkdir -p @localstatedir@ ; \ if test ! -z "$(INSTALL_LOCALSTATE)"; then \ $(INSTALL) -s $(INSTALL_LOCALSTATE) @localstatedir@ ; \ fi install_data: $(INSTALL_DATA) mkdir -p @datadir@/magellan ; \ mkdir -p @datadir@/magellan/bitmap ; \ mkdir -p @datadir@/magellan/outline ; \ mkdir -p @datadir@/magellan/point ; \ mkdir -p @datadir@/magellan/fragment/projection ; \ mkdir -p @datadir@/magellan/fragment/content ; \ if test ! -z "$(INSTALL_BITMAP_DATA)"; then \ $(INSTALL) -s $(INSTALL_BITMAP_DATA) @datadir@/bitmap ; \ fi ; \ if test ! -z "$(INSTALL_OUTLINE_DATA)"; then \ $(INSTALL) -s $(INSTALL_OUTLINE_DATA) @datadir@/outline ; \ fi ; \ ### # Uninstallation of files uninstall: uninstall_bin uninstall_sbin uninstall_local uninstall_bin: -rm -f $(foreach file,$(notdir $(INSTALL_BIN)),@bindir@/$file) uninstall_sbin: -rm -f $(foreach file,$(notdir $(INSTALL_SBIN)),@sbindir@/$file) uninstall_lib: -rm -f $(foreach file,$(notdir $(INSTALL_LIB)),@libdir@/$file) uninstall_local: -rm -f $(foreach file,$(notdir $(INSTALL_LOCALSTATE)),@localstatedir@/$file) ### # Making a distribution set DIST_FILES := $(SRC_DIST) $(DOC_DIST) $(EXTRA_DIST) \ $(foreach mf,$(MAKEFILES),$(mf).in) Makefile.in \ config.h.in configure.in configure config.sub config.guess \ mkdepend install-sh stamp-h.in \ CHANGELOG COPYING README TODO PACKAGEVERSION := @PACKAGE@-@VERSION@ DIST_DIR := $(PACKAGEVERSION) TARFILE := $(PACKAGEVERSION).tar@COMPRESS_EXT@ dist: $(TARFILE) # $(DATAFILE_BASIC) $(TARFILE): $(DIST_FILES) mkdir -p $(DIST_DIR) @for d in $(sort $(dir $(DIST_FILES))) ; do \ mkdir -p $(DIST_DIR)/$$d ; \ done @for f in $(DIST_FILES) ; do \ cp $$f $(DIST_DIR)/$$f ; \ done $(TAR) -cf $(PACKAGEVERSION).tar $(DIST_DIR) $(COMPRESS) $(PACKAGEVERSION).tar # $(DATAFILE_BASIC): $(DATA_BASIC_FILES) # mkdir -p $(DIST_DATA_BASIC_DIR) ### # Libtool support %.lo: %.cc ( cd $(dir $<) ; $(LIBTOOL) --mode=compile $(CXX) $(CXXFLAGS) -I.. -c $(notdir $<) ) ### # Autoconf support configure: configure.in aclocal.m4 autoconf config.h.in: stamp-h.in stamp-h.in: configure.in aclocal.m4 autoheader @echo timestamp > stamp-h.in config.h: stamp-h stamp-h: config.h.in config.status ./config.status @echo timestamp >stamp-h aclocal.m4: aclocal #acinclude.m4 %/Makefile.mk: %/Makefile.mk.in ./config.status Makefile: Makefile.in ./config.status config.status: configure ./config.status --recheck