Add proper dependency tracking in the build.

pull/22/head
weetmuts 2019-03-15 13:59:26 +01:00
rodzic 0e82309d72
commit 6ad054aa23
1 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -52,9 +52,9 @@ $(shell mkdir -p $(BUILD))
CXXFLAGS := $(DEBUG_FLAGS) -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-unused-function "-DWMBUSMETERS_VERSION=\"$(VERSION)\""
$(BUILD)/%.o: src/%.cc $(wildcard src/%.h)
$(CXX) $(CXXFLAGS) $< -c -o $@
$(CXX) $(CXXFLAGS) $< -MMD -c -o $@
METERS_OBJS:=\
METER_OBJS:=\
$(BUILD)/aes.o \
$(BUILD)/cmdline.o \
$(BUILD)/config.o \
@ -104,12 +104,12 @@ wmbusmeters_$(VERSION)_$(DEBARCH).deb:
@mv $(BUILD)/debian/wmbusmeters_$(VERSION)_$(DEBARCH).deb .
@echo Built package $@
$(BUILD)/wmbusmeters: $(METERS_OBJS) $(BUILD)/main.o
$(CXX) -o $(BUILD)/wmbusmeters $(METERS_OBJS) $(BUILD)/main.o $(DEBUG_LDFLAGS) -lpthread
$(BUILD)/wmbusmeters: $(METER_OBJS) $(BUILD)/main.o
$(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(DEBUG_LDFLAGS) -lpthread
$(BUILD)/testinternals: $(METERS_OBJS) $(BUILD)/testinternals.o
$(CXX) -o $(BUILD)/testinternals $(METERS_OBJS) $(BUILD)/testinternals.o $(DEBUG_LDFLAGS) -lpthread
$(BUILD)/testinternals: $(METER_OBJS) $(BUILD)/testinternals.o
$(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(DEBUG_LDFLAGS) -lpthread
clean:
rm -rf build/* build_arm/* build_debug/* build_arm_debug/* *~
@ -159,3 +159,7 @@ update_manufacturers:
echo '#endif' >> m.h
rm tmpfile
mv m.h src/manufacturers.h
# Include dependency information generated by gcc in a previous compile.
include $(wildcard $(patsubst %.o,%.d,$(METER_OBJS)))