DEADSOFTWARE

Organize into directories (to split up .cc files later)
authorGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Tue, 15 Nov 2011 14:47:40 +0000 (14:47 +0000)
committerGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Tue, 15 Nov 2011 15:08:09 +0000 (15:08 +0000)
22 files changed:
Makefile
alien/Make.inc [new file with mode: 0644]
alien/alien.cc [moved from alien.cc with 100% similarity]
alien/alien.h [moved from alien.h with 100% similarity]
fold/Make.inc [new file with mode: 0644]
fold/fold.cc [moved from fold.cc with 100% similarity]
fold/fold.h [moved from fold.h with 100% similarity]
reader/Make.inc [new file with mode: 0644]
reader/oberon.h [moved from oberon.h with 100% similarity]
reader/reader.cc [moved from reader.cc with 100% similarity]
reader/reader.h [moved from reader.h with 100% similarity]
reader/util.cc [moved from util.cc with 100% similarity]
store/Make.inc [new file with mode: 0644]
store/store.cc [moved from store.cc with 100% similarity]
store/store.h [moved from store.h with 100% similarity]
textmodel/Make.inc [new file with mode: 0644]
textmodel/textmodel.cc [moved from textmodel.cc with 100% similarity]
textmodel/textmodel.h [moved from textmodel.h with 100% similarity]
typeregister/Make.inc [new file with mode: 0644]
typeregister/typeregister.cc [moved from typeregister.cc with 100% similarity]
typeregister/typeregister.h [moved from typeregister.h with 100% similarity]
visitor/visitor.h [moved from visitor.h with 100% similarity]

index 441faf9a7e82cf364d1f069d029307221b7bbdba..94be64aa62d6a2830bc12d153a9f158d43aeafb6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,13 @@
-# List all source files to be compiled
-SRCS=odcread.cc reader.cc store.cc util.cc alien.cc typeregister.cc \
-       textmodel.cc fold.cc 
+MODULES := reader store alien typeregister textmodel fold
+
+# Add module directories to the include path
+CFLAGS += -I. $(patsubst %,-I%,$(MODULES))
+
+# Variables for the modules to write to
+SRCS := odcread.cc
+
+# Include module definitions
+include $(patsubst %,%/Make.inc,$(MODULES))
 
 # This rule just links the object files together
 odcread: $(SRCS:.cc=.o)
@@ -17,11 +24,11 @@ odcread: $(SRCS:.cc=.o)
 # The .d file is not an explicit target because it will need to be (re-)built
 # if and only if the .o needs to be rebuilt.
 %.o: %.cc
-       g++ -I. $< -MM -MF $*.d -MP -MT $@
-       g++ -I. $< -c -o $@
+       g++ $(CFLAGS) $< -MM -MF $*.d -MP -MT $@
+       g++ $(CFLAGS) $< -c -o $@
 
 clean:
-       rm -f odcread *.d *.o
+       rm -f odcread *.d *.o */*.o */*.d
 
 # Include the generated dependency files (if they exist)
 -include $(SRCS:.cc=.d)
diff --git a/alien/Make.inc b/alien/Make.inc
new file mode 100644 (file)
index 0000000..6a6a6a6
--- /dev/null
@@ -0,0 +1 @@
+SRCS += alien/alien.cc
similarity index 100%
rename from alien.cc
rename to alien/alien.cc
similarity index 100%
rename from alien.h
rename to alien/alien.h
diff --git a/fold/Make.inc b/fold/Make.inc
new file mode 100644 (file)
index 0000000..8b7c74e
--- /dev/null
@@ -0,0 +1 @@
+SRCS += fold/fold.cc
similarity index 100%
rename from fold.cc
rename to fold/fold.cc
similarity index 100%
rename from fold.h
rename to fold/fold.h
diff --git a/reader/Make.inc b/reader/Make.inc
new file mode 100644 (file)
index 0000000..caf7946
--- /dev/null
@@ -0,0 +1 @@
+SRCS += reader/reader.cc reader/util.cc
similarity index 100%
rename from oberon.h
rename to reader/oberon.h
similarity index 100%
rename from reader.cc
rename to reader/reader.cc
similarity index 100%
rename from reader.h
rename to reader/reader.h
similarity index 100%
rename from util.cc
rename to reader/util.cc
diff --git a/store/Make.inc b/store/Make.inc
new file mode 100644 (file)
index 0000000..0316a57
--- /dev/null
@@ -0,0 +1 @@
+SRCS += store/store.cc
similarity index 100%
rename from store.cc
rename to store/store.cc
similarity index 100%
rename from store.h
rename to store/store.h
diff --git a/textmodel/Make.inc b/textmodel/Make.inc
new file mode 100644 (file)
index 0000000..f680811
--- /dev/null
@@ -0,0 +1 @@
+SRCS += textmodel/textmodel.cc
similarity index 100%
rename from textmodel.cc
rename to textmodel/textmodel.cc
similarity index 100%
rename from textmodel.h
rename to textmodel/textmodel.h
diff --git a/typeregister/Make.inc b/typeregister/Make.inc
new file mode 100644 (file)
index 0000000..d237e38
--- /dev/null
@@ -0,0 +1 @@
+SRCS += typeregister/typeregister.cc
similarity index 100%
rename from typeregister.cc
rename to typeregister/typeregister.cc
similarity index 100%
rename from typeregister.h
rename to typeregister/typeregister.h
similarity index 100%
rename from visitor.h
rename to visitor/visitor.h