diff --git a/.gitignore b/.gitignore index 1236c25..3afbbe9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /compile_commands.json -/out +/build /docs/*.pdf /ain48 diff --git a/Makefile b/Makefile index 81c37f4..05aea33 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,8 @@ LDFLAGS += $(shell pkg-config --libs $(LIBS)) # FILES SRCS=$(wildcard src/*.c) -DEPS=$(patsubst src/%.c, out/%.d, $(SRCS)) -OBJS=$(patsubst src/%.c, out/%.o, $(SRCS)) +DEPS=$(patsubst src/%.c, build/%.d, $(SRCS)) +OBJS=$(patsubst src/%.c, build/%.o, $(SRCS)) DOCSRC=$(wildcard docs/*.typ) DOCS=$(patsubst docs/%.typ, docs/%.pdf, $(DOCSRC)) @@ -37,25 +37,24 @@ docs/%.pdf: docs/%.typ $(TYPST) c $< $@ clean: - $(RM) $(PROGRAM) - $(RM) $(DOCS) -deepclean: clean $(RM) $(OBJS) $(RM) $(DEPS) $(RM) compile_commands.json +deepclean: clean + $(RM) $(PROGRAM) + $(RM) $(DOCS) $(PROGRAM): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) -o $@ - -out/%.d: src/%.c +build/%.d: src/%.c @mkdir -p $(@D) @set -e ; $(RM) $@; \ $(CC) -M $(CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,out/\1.o $@ : ,g' < $@.$$$$ > $@; \ + sed 's,\($*\)\.o[ :]*,build/\1.o $@ : ,g' < $@.$$$$ > $@; \ $(RM) $@.$$$$ -out/%.o: src/%.c +build/%.o: src/%.c @mkdir -p $(@D) $(CC) $(CFLAGS) -c $< -o $@