| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-01 21:15:52 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-09-01 21:15:52 +0200 |
| commit | 2b1c103df8a566f1fee62a040da079a052cee83f (patch) | |
| tree | 71a80b80298b3529df10830e3ae1b9b76babbb01 /src/Makefile | |
| parent | 8a37d71ce6ca77f87f773299461cbdbf2058565b (diff) | |
Switches to Makefiles.
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..8ffa1ab --- /dev/null +++ b/src/Makefile @@ -0,0 +1,30 @@ +SUBCOMPONENTS = $(dir $(filter-out "./Makefile",$(wildcard ./*/Makefile))) +SUBCOMPONENTS_EXPORT = $(addsuffix /export.a,$(SUBCOMPONENTS)) +################################################################################ +SRC_FILES = $(wildcard ./*.c) +OBJ_FILES = $(SRC_FILES:.c=.o) +DEP_FILES = $(SRC_FILES:.c=.d) +################################################################################ +build: export.a + +export.a: $(OBJ_FILES) $(SUBCOMPONENTS_EXPORT) + ar -crT $@ $^ + +$(SUBCOMPONENTS_EXPORT): + $(MAKE) -C $(dir $@) export.a + +clean: + rm -f $(OBJ_FILES) + rm -f $(DEP_FILES) + rm -f export.a + for subcmp in $(SUBCOMPONENTS) ; do \ + $(MAKE) -C $$subcmp clean ; \ + done +################################################################################ +%.d: %.c + @set -e; rm -f $@; \ + $(CC) -M $(CPPFLAGS) $< > $@.$$$$; \ + sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + rm -f $@.$$$$ + +include $(DEP_FILES) |


