mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
src: use correct flags for compiling .c files, fix missing dependencies
fiewalk and fiemap depend on a lot of crucible, and incremental builds fail hard without proper dependency tracking. All binaries must be rebuilt when makeflags changes. This dependency exists already in lib and test, but src was missing. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
parent
d2ecb4c9ea
commit
ab5316a3da
11
src/Makefile
11
src/Makefile
@ -3,6 +3,8 @@ PROGRAMS = \
|
|||||||
../bin/fiemap \
|
../bin/fiemap \
|
||||||
../bin/fiewalk \
|
../bin/fiewalk \
|
||||||
|
|
||||||
|
PROGRAM_OBJS = $(foreach b,$(PROGRAMS),$(patsubst ../bin/%,%.o,$(b)))
|
||||||
|
|
||||||
all: $(BEES) $(PROGRAMS)
|
all: $(BEES) $(PROGRAMS)
|
||||||
|
|
||||||
include ../makeflags
|
include ../makeflags
|
||||||
@ -19,6 +21,8 @@ BEES_OBJS = \
|
|||||||
bees-thread.o \
|
bees-thread.o \
|
||||||
bees-types.o \
|
bees-types.o \
|
||||||
|
|
||||||
|
ALL_OBJS = $(BEES_OBJS) $(PROGRAM_OBJS)
|
||||||
|
|
||||||
bees-version.c: bees.h $(BEES_OBJS:.o=.cc) Makefile
|
bees-version.c: bees.h $(BEES_OBJS:.o=.cc) Makefile
|
||||||
echo "const char *BEES_VERSION = \"$(BEES_VERSION)\";" > bees-version.new.c
|
echo "const char *BEES_VERSION = \"$(BEES_VERSION)\";" > bees-version.new.c
|
||||||
mv -f bees-version.new.c bees-version.c
|
mv -f bees-version.new.c bees-version.c
|
||||||
@ -33,13 +37,16 @@ bees-usage.c: bees-usage.txt Makefile
|
|||||||
.depends/%.dep: %.cc Makefile | .depends
|
.depends/%.dep: %.cc Makefile | .depends
|
||||||
$(CXX) $(BEES_CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $<
|
$(CXX) $(BEES_CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $<
|
||||||
|
|
||||||
depends.mk: $(BEES_OBJS:%.o=.depends/%.dep)
|
depends.mk: $(ALL_OBJS:%.o=.depends/%.dep)
|
||||||
cat $^ > $@.new
|
cat $^ > $@.new
|
||||||
mv -f $@.new $@
|
mv -f $@.new $@
|
||||||
|
|
||||||
include depends.mk
|
include depends.mk
|
||||||
|
|
||||||
$(BEES_OBJS) fiemap.o fiewalk.o: %.o: %.cc
|
%.o: %.c ../makeflags
|
||||||
|
$(CC) $(BEES_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
%.o: %.cc ../makeflags
|
||||||
$(CXX) $(BEES_CXXFLAGS) -o $@ -c $<
|
$(CXX) $(BEES_CXXFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
$(PROGRAMS): ../bin/%: %.o
|
$(PROGRAMS): ../bin/%: %.o
|
||||||
|
Loading…
x
Reference in New Issue
Block a user