diff options
| author | 2026-03-15 00:51:18 +0100 | |
|---|---|---|
| committer | 2026-03-15 11:46:25 +0100 | |
| commit | b4caa5393f7a8ac5505c2892b85beb061196b78e (patch) | |
| tree | 52d143d0104ef08eb7816a68a3a7ae36f1d97d07 /Makefile | |
| parent | eb9538f7a647e0b3686edc967d932acb817d46d3 (diff) | |
build system: use custom depgen instead of gcc
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -16,6 +16,14 @@ BINDIR=$(PREFIX)/bin -include config.mk +HOSTCC ?= $(CC) + +ifdef V + V= +else + V=@ +endif + all: CFLAGS += -g -Og all: $(OUT) @@ -26,19 +34,22 @@ dbg: CFLAGS += -g -fsanitize=address,undefined dbg: CC:=clang dbg: $(OUT) -$(OUT): $(OBJ) +tool/depgen: tool/depgen.c + $(CC) -Wall -g -o $@ $< + +$(OUT): tool/depgen $(OBJ) $(CC) $(CFLAGS) -o $@ $(OBJ) hostconfig.h: ./configure $(BUILDDIR)/%.o: %.c hostconfig.h - @mkdir -p `dirname $@` - @cc $(CFLAGS) -w -MMD -MP -fsyntax-only -MF $(BUILDDIR)/$*.d -MT $@ $< #depfiles + $Vmkdir -p `dirname $@` + $Vtool/depgen -MP -MF $(BUILDDIR)/$*.d -MT $@ $< $(CC) $(CFLAGS) -c -o $@ $< clean: - $(RM) -r -- $(BUILDDIR)/ test/build/ $(OUT) *.o a.out + $(RM) -r -- $(BUILDDIR)/ test/build/ $(OUT) *.o a.out tool/depgen clean-config: clean $(RM) -r config.mk hostconfig.h |