From: Gert van Valkenhoef Date: Tue, 15 Nov 2011 14:47:40 +0000 (+0000) Subject: Organize into directories (to split up .cc files later) X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=7c27903f08ee6069172f92415888a825512cba01;p=odcread.git Organize into directories (to split up .cc files later) --- diff --git a/Makefile b/Makefile index 441faf9..94be64a 100644 --- 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 index 0000000..6a6a6a6 --- /dev/null +++ b/alien/Make.inc @@ -0,0 +1 @@ +SRCS += alien/alien.cc diff --git a/alien.cc b/alien/alien.cc similarity index 100% rename from alien.cc rename to alien/alien.cc diff --git a/alien.h b/alien/alien.h 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 index 0000000..8b7c74e --- /dev/null +++ b/fold/Make.inc @@ -0,0 +1 @@ +SRCS += fold/fold.cc diff --git a/fold.cc b/fold/fold.cc similarity index 100% rename from fold.cc rename to fold/fold.cc diff --git a/fold.h b/fold/fold.h 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 index 0000000..caf7946 --- /dev/null +++ b/reader/Make.inc @@ -0,0 +1 @@ +SRCS += reader/reader.cc reader/util.cc diff --git a/oberon.h b/reader/oberon.h similarity index 100% rename from oberon.h rename to reader/oberon.h diff --git a/reader.cc b/reader/reader.cc similarity index 100% rename from reader.cc rename to reader/reader.cc diff --git a/reader.h b/reader/reader.h similarity index 100% rename from reader.h rename to reader/reader.h diff --git a/util.cc b/reader/util.cc 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 index 0000000..0316a57 --- /dev/null +++ b/store/Make.inc @@ -0,0 +1 @@ +SRCS += store/store.cc diff --git a/store.cc b/store/store.cc similarity index 100% rename from store.cc rename to store/store.cc diff --git a/store.h b/store/store.h 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 index 0000000..f680811 --- /dev/null +++ b/textmodel/Make.inc @@ -0,0 +1 @@ +SRCS += textmodel/textmodel.cc diff --git a/textmodel.cc b/textmodel/textmodel.cc similarity index 100% rename from textmodel.cc rename to textmodel/textmodel.cc diff --git a/textmodel.h b/textmodel/textmodel.h 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 index 0000000..d237e38 --- /dev/null +++ b/typeregister/Make.inc @@ -0,0 +1 @@ +SRCS += typeregister/typeregister.cc diff --git a/typeregister.cc b/typeregister/typeregister.cc similarity index 100% rename from typeregister.cc rename to typeregister/typeregister.cc diff --git a/typeregister.h b/typeregister/typeregister.h similarity index 100% rename from typeregister.h rename to typeregister/typeregister.h diff --git a/visitor.h b/visitor/visitor.h similarity index 100% rename from visitor.h rename to visitor/visitor.h