### -*-makefile-*- ### ### Common definitions for build scripts ### ### (c) 2013 Straylight/Edgeware ### ###----- Licensing notice --------------------------------------------------- ### ### This file is part of Catacomb. ### ### Catacomb is free software; you can redistribute it and/or modify ### it under the terms of the GNU Library General Public License as ### published by the Free Software Foundation; either version 2 of the ### License, or (at your option) any later version. ### ### Catacomb is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRANTY; without even the implied warranty of ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ### GNU Library General Public License for more details. ### ### You should have received a copy of the GNU Library General Public ### License along with Catacomb; if not, write to the Free ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ### MA 02111-1307, USA. ###-------------------------------------------------------------------------- ### Miscellaneous useful definitions. ## Installation directories. archincludedir = $(pkglibdir)/include ###-------------------------------------------------------------------------- ### Initial values of common variables. EXTRA_DIST = CLEANFILES = DISTCLEANFILES = MAINTAINERCLEANFILES = SUFFIXES = TESTS = BUILT_SOURCES = EXTRA_PROGRAMS = noinst_PROGRAMS = check_PROGRAMS = pkginclude_HEADERS = nodist_pkginclude_HEADERS = archinclude_HEADERS = nodist_archinclude_HEADERS = ###-------------------------------------------------------------------------- ### Machinery for precomputations. ## Location of precomputed tables. precomp = $(top_srcdir)/precomp ## Precomputed source code files. PRECOMPS = EXTRA_DIST += $(PRECOMPS) BUILT_SOURCES += $(PRECOMPS) MAINTAINERCLEANFILES += $(PRECOMPS) ## Programs which make the tables. These should be made by an explicit ## recursive `make' call in the relevant rule, so that we don't try to ## reconstruct them unnecessarily. PRECOMP_PROGS = EXTRA_PROGRAMS += $(PRECOMP_PROGS) CLEANFILES += $(PRECOMP_PROGS) ###-------------------------------------------------------------------------- ### Standard configuration substitutions. ## Substitute tags in files. confsubst = $(top_srcdir)/config/confsubst SUBSTITUTIONS = \ prefix=$(prefix) exec_prefix=$(exec_prefix) \ libdir=$(libdir) includedir=$(includedir) \ PACKAGE=$(PACKAGE) VERSION=$(VERSION) \ CATACOMB_LIBS="$(CATACOMB_LIBS)" V_SUBST = $(V_SUBST_@AM_V@) V_SUBST_ = $(V_SUBST_@AM_DEFAULT_V@) V_SUBST_0 = @echo " SUBST $@"; SUBST = $(V_SUBST)$(confsubst) ###-------------------------------------------------------------------------- ### Include path. CATACOMB_INCLUDES = \ -I$(top_srcdir) \ -I$(precomp)/math \ -I$(precomp)/misc \ -I$(precomp)/symm \ -I$(top_srcdir)/base \ -I$(top_srcdir)/key \ -I$(top_srcdir)/math \ -I$(top_builddir)/math \ -I$(top_srcdir)/misc \ -I$(top_srcdir)/pub \ -I$(top_srcdir)/rand \ -I$(top_srcdir)/symm \ -I$(top_srcdir)/symm/modes -I$(top_builddir)/symm/modes AM_CPPFLAGS = $(CATACOMB_INCLUDES) ###-------------------------------------------------------------------------- ### Testing. TEST_EXTENSIONS = .t SUFFIXES += .c .t$(EXEEXT) .to ## This unpleasant duplication of rules makes the build system basically work ## for non-GNU make(1) variants, while GNU Make will associate useful ## additional dependencies with the test programs. GNU Make seems not to ## mind the duplicate rules, and uses the second (better) set; non-GNU Make ## will think the second set refer to bizarrely-named targets which nobody is ## apparently interested in. .c.to: $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ .to.t$(EXEEXT): $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $< \ $(TEST_LIBS) $(top_builddir)/libcatacomb.la \ $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS) %.to: %.c %.lo $(AM_V_CC)$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" $< -o $@ %.t$(EXEEXT): %.to $(TEST_LIBS) $(top_builddir)/libcatacomb.la $(AM_V_CCLD)$(LINK) $(TEST_LDFLAGS) $+ \ $(mLib_LIBS) $(CATACOMB_LIBS) $(LIBS) .PRECIOUS: %.to %.t$(EXEEXT) CLEANFILES += *.to *.t$(EXEEXT) ###-------------------------------------------------------------------------- ### Experimental flymake hack. check-syntax: $(COMPILE) -S -o/dev/null \ -DTEST_RIG -DSRCDIR=\"$(SRCDIR)\" \ $(CHK_SOURCES) ###----- That's all, folks --------------------------------------------------