X-Git-Url: https://deadsoftware.ru/gitweb?p=odcread.git;a=blobdiff_plain;f=Makefile;h=94be64aa62d6a2830bc12d153a9f158d43aeafb6;hp=441faf9a7e82cf364d1f069d029307221b7bbdba;hb=7c27903f08ee6069172f92415888a825512cba01;hpb=149d7ca4cf84c3c9b7eb55b02d6b152fb00894bf 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)