From 816241afc2a91e54e86b4534ce5264f11d229dc6 Mon Sep 17 00:00:00 2001 From: Gert van Valkenhoef Date: Tue, 15 Nov 2011 20:34:08 +0000 Subject: [PATCH] Rename .ih files to module.ih for simplicity --- Makefile | 10 ++++------ alien/alien.cc | 2 +- alien/{alien.ih => module.ih} | 0 alien/part.cc | 2 +- alien/piece.cc | 2 +- fold/fold.cc | 2 +- fold/{fold.ih => module.ih} | 0 main/{main.ih => module.ih} | 0 main/odcread.cc | 2 +- reader/addPathComponent.cc | 2 +- reader/fixTypeName.cc | 2 +- reader/{reader.ih => module.ih} | 0 reader/readAlien.cc | 2 +- reader/readLinkStore.cc | 3 +-- reader/readNewLinkStore.cc | 2 +- reader/readNilStore.cc | 2 +- reader/readPath.cc | 2 +- reader/readStore.cc | 2 +- reader/readStoreOrElemStore.cc | 2 +- reader/readVersion.cc | 2 +- reader/reader.cc | 2 +- reader/util.cc | 2 +- store/{store.ih => module.ih} | 0 store/store.cc | 2 +- textmodel/{textmodel.ih => module.ih} | 0 textmodel/textmodel.cc | 2 +- typepath/{typepath.ih => module.ih} | 0 typepath/toString.cc | 2 +- typeregister/{typeregister.ih => module.ih} | 0 typeregister/typeregister.cc | 2 +- 30 files changed, 25 insertions(+), 28 deletions(-) rename alien/{alien.ih => module.ih} (100%) rename fold/{fold.ih => module.ih} (100%) rename main/{main.ih => module.ih} (100%) rename reader/{reader.ih => module.ih} (100%) rename store/{store.ih => module.ih} (100%) rename textmodel/{textmodel.ih => module.ih} (100%) rename typepath/{typepath.ih => module.ih} (100%) rename typeregister/{typeregister.ih => module.ih} (100%) diff --git a/Makefile b/Makefile index 415e325..7a09b51 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # * $(MODULE)/*.cc -- module source files MODULES := main reader store alien typeregister textmodel fold typepath -CFLAGS := -I. +CFLAGS += -I. # Variables for the modules to write to SRCS := @@ -18,6 +18,7 @@ include $(patsubst %,%/Make.inc,$(MODULES)) odcread: $(SRCS:.cc=.o) g++ -o $@ $^ +# This rule build an object (.o) from a source (.cc). %.o: %.cc g++ $(CFLAGS) $< -c -o $@ @@ -32,15 +33,14 @@ 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 .ih.gch needs to be rebuilt. %.ih.gch: %.ih - g++ $(CFLAGS) -x c++-header $< -MM -MF $(dir $@)module.d -MP -MT $@ + g++ $(CFLAGS) -x c++-header $< -MM -MF $*.d -MP -MT $@ g++ $(CFLAGS) -x c++-header $< -o $@ -# This rule build an object (.o) from a source (.cc). # Each module has a .ih file that should be *the only* include from the .cc # files. These .ih files are pre-compiled to .ih.gch, and dependency caching # is based on the .ih files, not the .cc files. define depend_on_compiled_header -$(patsubst %.cc,%.o,$(1)) : $(dir $(1))$(patsubst %/,%,$(dir $(1))).ih.gch +$(patsubst %.cc,%.o,$(1)) : $(dir $(1))module.ih.gch endef $(foreach src,$(SRCS),$(eval $(call depend_on_compiled_header,$(src)))) @@ -49,5 +49,3 @@ clean: # Include the generated dependency files (if they exist) -include $(patsubst %,%/module.d,$(MODULES)) - -# TODO: rename all %/%.ih files to %/module.ih for simplicity of matching rules diff --git a/alien/alien.cc b/alien/alien.cc index d00a4b8..102c8ca 100644 --- a/alien/alien.cc +++ b/alien/alien.cc @@ -1,4 +1,4 @@ -#include "alien/alien.ih" +#include "alien/module.ih" namespace odc { diff --git a/alien/alien.ih b/alien/module.ih similarity index 100% rename from alien/alien.ih rename to alien/module.ih diff --git a/alien/part.cc b/alien/part.cc index 1f7ff47..8807c99 100644 --- a/alien/part.cc +++ b/alien/part.cc @@ -1,4 +1,4 @@ -#include "alien/alien.ih" +#include "alien/module.ih" namespace odc { diff --git a/alien/piece.cc b/alien/piece.cc index 82e3a0c..1aa7bd8 100644 --- a/alien/piece.cc +++ b/alien/piece.cc @@ -1,4 +1,4 @@ -#include "alien/alien.ih" +#include "alien/module.ih" namespace odc { diff --git a/fold/fold.cc b/fold/fold.cc index 94ed587..9a0195f 100644 --- a/fold/fold.cc +++ b/fold/fold.cc @@ -1,4 +1,4 @@ -#include "fold/fold.ih" +#include "fold/module.ih" namespace odc { diff --git a/fold/fold.ih b/fold/module.ih similarity index 100% rename from fold/fold.ih rename to fold/module.ih diff --git a/main/main.ih b/main/module.ih similarity index 100% rename from main/main.ih rename to main/module.ih diff --git a/main/odcread.cc b/main/odcread.cc index 075671f..9a7f95a 100644 --- a/main/odcread.cc +++ b/main/odcread.cc @@ -1,4 +1,4 @@ -#include "main/main.ih" +#include "main/module.ih" namespace odc { class Context { diff --git a/reader/addPathComponent.cc b/reader/addPathComponent.cc index 5def034..33fae6a 100644 --- a/reader/addPathComponent.cc +++ b/reader/addPathComponent.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/fixTypeName.cc b/reader/fixTypeName.cc index cc33fe5..a426908 100644 --- a/reader/fixTypeName.cc +++ b/reader/fixTypeName.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/reader.ih b/reader/module.ih similarity index 100% rename from reader/reader.ih rename to reader/module.ih diff --git a/reader/readAlien.cc b/reader/readAlien.cc index 2ccf9f0..ba96ca5 100644 --- a/reader/readAlien.cc +++ b/reader/readAlien.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readLinkStore.cc b/reader/readLinkStore.cc index b087189..31bd74a 100644 --- a/reader/readLinkStore.cc +++ b/reader/readLinkStore.cc @@ -1,5 +1,4 @@ - -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readNewLinkStore.cc b/reader/readNewLinkStore.cc index 24f8806..5e3fba1 100644 --- a/reader/readNewLinkStore.cc +++ b/reader/readNewLinkStore.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readNilStore.cc b/reader/readNilStore.cc index aa1e4f2..9f905e6 100644 --- a/reader/readNilStore.cc +++ b/reader/readNilStore.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readPath.cc b/reader/readPath.cc index 397f2ac..f92bfd0 100644 --- a/reader/readPath.cc +++ b/reader/readPath.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readStore.cc b/reader/readStore.cc index 1ab921f..f976936 100644 --- a/reader/readStore.cc +++ b/reader/readStore.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readStoreOrElemStore.cc b/reader/readStoreOrElemStore.cc index 0c89bb3..168fc73 100644 --- a/reader/readStoreOrElemStore.cc +++ b/reader/readStoreOrElemStore.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/readVersion.cc b/reader/readVersion.cc index 5b13aff..799885d 100644 --- a/reader/readVersion.cc +++ b/reader/readVersion.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/reader.cc b/reader/reader.cc index 1395bba..ec731bd 100644 --- a/reader/reader.cc +++ b/reader/reader.cc @@ -1,4 +1,4 @@ -#include "reader/reader.ih" +#include "reader/module.ih" namespace odc { diff --git a/reader/util.cc b/reader/util.cc index 76cd6af..0d53e11 100644 --- a/reader/util.cc +++ b/reader/util.cc @@ -1,4 +1,4 @@ -#include "reader/reader.h" +#include "reader/module.ih" namespace odc { bool Reader::isBigEndian() { // http://stackoverflow.com/questions/1001307/detecting-endianness-programmatically-in-a-c-program diff --git a/store/store.ih b/store/module.ih similarity index 100% rename from store/store.ih rename to store/module.ih diff --git a/store/store.cc b/store/store.cc index a967518..e9dbb93 100644 --- a/store/store.cc +++ b/store/store.cc @@ -1,4 +1,4 @@ -#include "store/store.ih" +#include "store/module.ih" namespace odc { diff --git a/textmodel/textmodel.ih b/textmodel/module.ih similarity index 100% rename from textmodel/textmodel.ih rename to textmodel/module.ih diff --git a/textmodel/textmodel.cc b/textmodel/textmodel.cc index aa28193..b081a79 100644 --- a/textmodel/textmodel.cc +++ b/textmodel/textmodel.cc @@ -1,4 +1,4 @@ -#include "textmodel/textmodel.ih" +#include "textmodel/module.ih" namespace odc { diff --git a/typepath/typepath.ih b/typepath/module.ih similarity index 100% rename from typepath/typepath.ih rename to typepath/module.ih diff --git a/typepath/toString.cc b/typepath/toString.cc index dd532b1..25dc5fb 100644 --- a/typepath/toString.cc +++ b/typepath/toString.cc @@ -1,4 +1,4 @@ -#include "typepath/typepath.ih" +#include "typepath/module.ih" namespace odc { diff --git a/typeregister/typeregister.ih b/typeregister/module.ih similarity index 100% rename from typeregister/typeregister.ih rename to typeregister/module.ih diff --git a/typeregister/typeregister.cc b/typeregister/typeregister.cc index 0093b9a..05d780f 100644 --- a/typeregister/typeregister.cc +++ b/typeregister/typeregister.cc @@ -1,4 +1,4 @@ -#include "typeregister/typeregister.ih" +#include "typeregister/module.ih" namespace odc { -- 2.29.2