From 521ba651d7b6ae2c690b93b3ca10369a8c588d02 Mon Sep 17 00:00:00 2001 From: トトも <85485984+ElectronicsArchiver@users.noreply.github.com> Date: Sat, 16 Apr 2022 22:30:59 +0200 Subject: Keep Build Files In `build` (#89) --- Makefile | 61 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 29 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4ead32c..4b66c03 100644 --- a/Makefile +++ b/Makefile @@ -200,39 +200,42 @@ default: bfs all: $(BIN_GOALS) bfs: \ - bar.o \ - bftw.o \ - color.o \ - ctx.o \ - darray.o \ - diag.o \ - dir.o \ - dstring.o \ - eval.o \ - exec.o \ - fsade.o \ - main.o \ - mtab.o \ - opt.o \ - parse.o \ - printf.o \ - pwcache.o \ - stat.o \ - trie.o \ - typo.o \ - util.o \ - xregex.o \ - xspawn.o \ - xtime.o + build/bar.o \ + build/bftw.o \ + build/color.o \ + build/ctx.o \ + build/darray.o \ + build/diag.o \ + build/dir.o \ + build/dstring.o \ + build/eval.o \ + build/exec.o \ + build/fsade.o \ + build/main.o \ + build/mtab.o \ + build/opt.o \ + build/parse.o \ + build/printf.o \ + build/pwcache.o \ + build/stat.o \ + build/trie.o \ + build/typo.o \ + build/util.o \ + build/xregex.o \ + build/xspawn.o \ + build/xtime.o tests/mksock: tests/mksock.o -tests/trie: trie.o tests/trie.o -tests/xtimegm: xtime.o tests/xtimegm.o +tests/trie: build/trie.o tests/trie.o +tests/xtimegm: build/xtime.o tests/xtimegm.o $(BIN_GOALS): +$(CC) $(ALL_LDFLAGS) $^ $(ALL_LDLIBS) -o $@ -%.o: src/%.c .flags +build: + $(MKDIR) $@ + +build/%.o: src/%.c .flags | build $(CC) $(ALL_CFLAGS) -c $< -o $@ tests/%.o: tests/%.c .flags @@ -266,7 +269,7 @@ endif +$(MAKE) -B check $(DISTCHECK_FLAGS) clean: - $(RM) $(BIN_GOALS) .flags *.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno + $(RM) $(BIN_GOALS) .flags build/*.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno install: $(MKDIR) $(DESTDIR)$(PREFIX)/bin @@ -285,4 +288,4 @@ uninstall: .SUFFIXES: --include $(wildcard *.d) +-include $(wildcard build/*.d tests/*.d) \ No newline at end of file -- cgit v1.2.3