From 95feb5d4024c0d440a6891cfad6606dcb78f8b21 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 26 Aug 2010 05:06:31 +0000 Subject: * config/open-axiom.m4 (OPENAXIOM_BUILD_TOOLS): Check for ln -s and sed. * config/var-def.mk (oa_target_includedir): New. --- src/utils/Makefile.in | 36 ++++++++++++++++++++++++++++++------ src/utils/hammer.cc | 2 +- src/utils/hash-table.H | 2 +- src/utils/sexpr.H | 2 +- src/utils/sexpr.cc | 2 +- src/utils/storage.H | 2 +- src/utils/storage.cc | 4 ++-- src/utils/string-pool.H | 2 +- src/utils/string-pool.cc | 2 +- 9 files changed, 39 insertions(+), 15 deletions(-) (limited to 'src/utils') diff --git a/src/utils/Makefile.in b/src/utils/Makefile.in index b3adb6b9..4f43e115 100644 --- a/src/utils/Makefile.in +++ b/src/utils/Makefile.in @@ -40,9 +40,18 @@ libOpenAxiom_HEADERS = storage.H hash-table.H string-pool.H sexpr.H libOpenAxiom_SOURCES = storage.cc string-pool.cc sexpr.cc libOpenAxiom_OBJECTS = $(libOpenAxiom_SOURCES:.cc=.lo) +oa_public_headers = storage hash-table string-pool sexpr + +## Where we store public header files +oa_target_headerdir = $(oa_target_includedir)/open-axiom + +oa_include_flags = -I. -I$(oa_target_includedir) -I$(top_builddir)/config + .PHONY: all all-ax all-utils .SUFFIXES: -.SUFFIXES: .cc .H $(OBJEXT) $(LIBEXT) +.SUFFIXES: .cc .H .$(OBJEXT) .$(LIBEXT) +.PRECIOUS: %.lo %.$(OBJEXT) + all: all-ax @@ -52,9 +61,23 @@ stamp: libOpenAxiom.$(LIBEXT) hammer$(EXEEXT) -rm -f stamp $(STAMP) stamp -.SUFFIXES: -.SUFFIXES: .c .h .lo .$(OBJEXT) -.PRECIOUS: %.lo %.obj +stamp-headers: $(libOpenAxiom_HEADERS) Makefile + rm -f stamp-headers + if [ ! -d $(oa_target_headerdir) ]; then \ + mkdir -p -- $(oa_target_headerdir) || exit 1; \ + fi ; \ + c1=$(top_builddir)/config/openaxiom-c-macros.h; \ + c2=$(oa_target_headerdir)/config; \ + if [ ! -r $$c2 ] || ! cmp -s $$c1 $$c2 ; then \ + cp -p $$c1 $$c2; \ + fi ; \ + for h in $(oa_public_headers); do \ + f1=$(srcdir)/$$h.H; f2=$(oa_target_headerdir)/$$h; \ + if [ ! -r $$f2 ] || ! cmp -s $$f1 $$f2 ; then \ + cp -p $$f1 $$f2; \ + fi; \ + done ; \ + $(STAMP) stamp-headers hammer$(EXEEXT): $(hammer_OBJECTS) libOpenAxiom.$(LIBEXT) $(CXXLINK) -o $@ $(hammer_OBJECTS) $(hammer_LDADD) $(LDFLAGS) @@ -62,12 +85,13 @@ hammer$(EXEEXT): $(hammer_OBJECTS) libOpenAxiom.$(LIBEXT) libOpenAxiom.$(LIBEXT): $(libOpenAxiom_OBJECTS) $(CXXLINK) -o $@ $(libOpenAxiom_OBJECTS) -%.lo: %.cc $(libOpenAxiom_HEADERS) - $(CXXCOMPILE) ${CXXFLAGS} -I. -I$(top_builddir)/config -o $@ $< +%.lo: %.cc stamp-headers + $(CXXCOMPILE) ${CXXFLAGS} $(oa_include_flags) -o $@ $< mostlyclean-local: @rm -rf .libs + @rm -rf $(oa_include_headerdir) stamp-headers @rm -f $(libOpenAxiom_OBJECTS) @rm -f *~ core diff --git a/src/utils/hammer.cc b/src/utils/hammer.cc index 35ef5c1f..3ab56c72 100644 --- a/src/utils/hammer.cc +++ b/src/utils/hammer.cc @@ -48,7 +48,7 @@ #include #include #include -#include "storage.H" +#include namespace OpenAxiom { namespace Hammer { diff --git a/src/utils/hash-table.H b/src/utils/hash-table.H index 75b485ff..f5a2c7d0 100644 --- a/src/utils/hash-table.H +++ b/src/utils/hash-table.H @@ -37,7 +37,7 @@ // --% Simple hash table facility. To be replaced by C++0x // --% hash tables when C++0x compilers become common place. -#include "storage.H" +#include namespace OpenAxiom { // -------------------- diff --git a/src/utils/sexpr.H b/src/utils/sexpr.H index 5139b453..3059dce5 100644 --- a/src/utils/sexpr.H +++ b/src/utils/sexpr.H @@ -44,7 +44,7 @@ #include #include #include -#include "string-pool.H" +#include // Helpers for defining token type values for lexeme with more // than characters. diff --git a/src/utils/sexpr.cc b/src/utils/sexpr.cc index d9d38220..248c0649 100644 --- a/src/utils/sexpr.cc +++ b/src/utils/sexpr.cc @@ -34,7 +34,7 @@ #include #include #include -#include "sexpr.H" +#include namespace OpenAxiom { namespace Sexpr { diff --git a/src/utils/storage.H b/src/utils/storage.H index 60d5c0b4..03b03604 100644 --- a/src/utils/storage.H +++ b/src/utils/storage.H @@ -43,7 +43,7 @@ #include #include -#include "openaxiom-c-macros.h" +#include namespace OpenAxiom { // ----------------- diff --git a/src/utils/storage.cc b/src/utils/storage.cc index 4883de6c..a023e945 100644 --- a/src/utils/storage.cc +++ b/src/utils/storage.cc @@ -31,7 +31,7 @@ // --%: Gabriel Dos Reis. -#include "openaxiom-c-macros.h" +#include #ifdef HAVE_SYS_TYPES_H # include @@ -56,7 +56,7 @@ #include #include #include // for placement new. -#include "storage.H" +#include namespace OpenAxiom { // ---------------- diff --git a/src/utils/string-pool.H b/src/utils/string-pool.H index f3692a79..ae90409b 100644 --- a/src/utils/string-pool.H +++ b/src/utils/string-pool.H @@ -33,7 +33,7 @@ #define OPENAXIOM_STRING_POOL_INCLUDED #include -#include "hash-table.H" +#include // --% Author: Gabriel Dos Reis. // --% Description: diff --git a/src/utils/string-pool.cc b/src/utils/string-pool.cc index 5ae6b15d..0c529ace 100644 --- a/src/utils/string-pool.cc +++ b/src/utils/string-pool.cc @@ -31,7 +31,7 @@ // --% Author: Gabriel Dos Reis -#include "string-pool.H" +#include namespace OpenAxiom { // ---------------- -- cgit v1.2.3