aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-08-26 05:06:31 +0000
committerdos-reis <gdr@axiomatics.org>2010-08-26 05:06:31 +0000
commit95feb5d4024c0d440a6891cfad6606dcb78f8b21 (patch)
tree10b3e007e1b8df0506a861d42a3feb8d9df10202 /src/utils
parent5a9b61c826838b7f97db1ad3b3c350482d407377 (diff)
downloadopen-axiom-95feb5d4024c0d440a6891cfad6606dcb78f8b21.tar.gz
* config/open-axiom.m4 (OPENAXIOM_BUILD_TOOLS): Check for ln -s
and sed. * config/var-def.mk (oa_target_includedir): New.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/Makefile.in36
-rw-r--r--src/utils/hammer.cc2
-rw-r--r--src/utils/hash-table.H2
-rw-r--r--src/utils/sexpr.H2
-rw-r--r--src/utils/sexpr.cc2
-rw-r--r--src/utils/storage.H2
-rw-r--r--src/utils/storage.cc4
-rw-r--r--src/utils/string-pool.H2
-rw-r--r--src/utils/string-pool.cc2
9 files changed, 39 insertions, 15 deletions
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 <list>
#include <vector>
#include <map>
-#include "storage.H"
+#include <open-axiom/storage>
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 <open-axiom/storage>
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 <iosfwd>
#include <vector>
#include <set>
-#include "string-pool.H"
+#include <open-axiom/string-pool>
// 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 <ctype.h>
#include <iostream>
#include <iterator>
-#include "sexpr.H"
+#include <open-axiom/sexpr>
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 <cmath>
#include <string>
-#include "openaxiom-c-macros.h"
+#include <open-axiom/config>
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 <open-axiom/config>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -56,7 +56,7 @@
#include <stdlib.h>
#include <string.h>
#include <new> // for placement new.
-#include "storage.H"
+#include <open-axiom/storage>
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 <string.h>
-#include "hash-table.H"
+#include <open-axiom/hash-table>
// --% 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 <open-axiom/string-pool>
namespace OpenAxiom {
// ----------------