Add generation of dependency files

Generate dependency files so that when changing one file only stuff
dependant on that file gets rebuilt. Avoid cleaning the whole thing on
every small change
This commit is contained in:
Geoffrey Merck F4FXL - KC3FRA 2018-11-11 17:13:17 +01:00
parent 86744087a4
commit e66484340b
18 changed files with 100 additions and 0 deletions

View file

@ -1,17 +1,23 @@
OBJECTS = TimerControlAppD.o TimerControlConfig.o TimerControlItemFile.o TimerControlRemoteControlHandler.o TimerControlThread.o \
TimerControlThreadHelper.o
.PHONY: all
all: timercontrold
timercontrold: $(OBJECTS)
$(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o timercontrold
-include $(OBJECTS:.o=.d)
%.o: %.cpp
$(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -c -o $@ $<
$(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common $< > $*.d
.PHONY: install
install:
install -g bin -o root -m 0775 timercontrold $(BINDIR)
.PHONY: clean
clean:
$(RM) timercontrold *.o *.d *.bak *~

View file

@ -2,17 +2,23 @@ OBJECTS = TimerControlApp.o TimerControlConfig.o TimerControlFrame.o TimerContro
TimerControlRemoteControlHandler.o TimerControlRemoteSet.o TimerControlRepeaterPanel.o TimerControlThread.o \
TimerControlThreadHelper.o
.PHONY: all
all: timercontrol
timercontrol: $(OBJECTS)
$(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o timercontrol
-include $(OBJECTS:.o=.d)
%.o: %.cpp
$(CXX) $(CFLAGS) -I../Common -I../GUICommon -c -o $@ $<
$(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon $< > $*.d
.PHONY: install
install:
install -g bin -o root -m 0775 timercontrol $(BINDIR)
.PHONY: clean
clean:
$(RM) timercontrol *.o *.d *.bak *~