From 05e62545d869236fb775d508de5e9f039ab4d979 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck F4FXL - KC3FRA Date: Tue, 13 Nov 2018 19:28:18 +0100 Subject: [PATCH 1/2] Use $(MAKE) variable This allows to propagate flags passed on the commande line --- Makefile | 22 +++++++++++----------- Makefile.Pi | 22 +++++++++++----------- MakefileGUI | 22 +++++++++++----------- MakefileGUIPi | 22 +++++++++++----------- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Makefile b/Makefile index 40858b1..b14327a 100644 --- a/Makefile +++ b/Makefile @@ -12,25 +12,25 @@ export LDFLAGS := all: DStarRepeater/dstarrepeaterd DStarRepeaterConfig/dstarrepeaterconfig DStarRepeater/dstarrepeaterd: Common/Common.a - make -C DStarRepeater + $(MAKE) -C DStarRepeater DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeaterConfig + $(MAKE) -C DStarRepeaterConfig GUICommon/GUICommon.a: - make -C GUICommon + $(MAKE) -C GUICommon Common/Common.a: - make -C Common + $(MAKE) -C Common install: all - make -C Data install - make -C DStarRepeater install - make -C DStarRepeaterConfig install + $(MAKE) -C Data install + $(MAKE) -C DStarRepeater install + $(MAKE) -C DStarRepeaterConfig install clean: - make -C Common clean - make -C GUICommon clean - make -C DStarRepeater clean - make -C DStarRepeaterConfig clean + $(MAKE) -C Common clean + $(MAKE) -C GUICommon clean + $(MAKE) -C DStarRepeater clean + $(MAKE) -C DStarRepeaterConfig clean diff --git a/Makefile.Pi b/Makefile.Pi index 9a8f23f..1fd706f 100644 --- a/Makefile.Pi +++ b/Makefile.Pi @@ -12,25 +12,25 @@ export LDFLAGS := all: DStarRepeater/dstarrepeaterd DStarRepeaterConfig/dstarrepeaterconfig DStarRepeater/dstarrepeaterd: Common/Common.a - make -C DStarRepeater + $(MAKE) -C DStarRepeater DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeaterConfig + $(MAKE) -C DStarRepeaterConfig GUICommon/GUICommon.a: - make -C GUICommon + $(MAKE) -C GUICommon Common/Common.a: - make -C Common + $(MAKE) -C Common install: all - make -C Data install - make -C DStarRepeater install - make -C DStarRepeaterConfig install + $(MAKE) -C Data install + $(MAKE) -C DStarRepeater install + $(MAKE) -C DStarRepeaterConfig install clean: - make -C Common clean - make -C GUICommon clean - make -C DStarRepeater clean - make -C DStarRepeaterConfig clean + $(MAKE) -C Common clean + $(MAKE) -C GUICommon clean + $(MAKE) -C DStarRepeater clean + $(MAKE) -C DStarRepeaterConfig clean diff --git a/MakefileGUI b/MakefileGUI index 4774fb4..1b2bfe8 100644 --- a/MakefileGUI +++ b/MakefileGUI @@ -12,25 +12,25 @@ export LDFLAGS := all: DStarRepeater/dstarrepeater DStarRepeaterConfig/dstarrepeaterconfig DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeater -f MakefileGUI + $(MAKE) -C DStarRepeater -f MakefileGUI DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeaterConfig + $(MAKE) -C DStarRepeaterConfig GUICommon/GUICommon.a: - make -C GUICommon + $(MAKE) -C GUICommon Common/Common.a: - make -C Common + $(MAKE) -C Common install: all - make -C Data install - make -C DStarRepeater -f MakefileGUI install - make -C DStarRepeaterConfig install + $(MAKE) -C Data install + $(MAKE) -C DStarRepeater -f MakefileGUI install + $(MAKE) -C DStarRepeaterConfig install clean: - make -C Common clean - make -C GUICommon clean - make -C DStarRepeater -f MakefileGUI clean - make -C DStarRepeaterConfig clean + $(MAKE) -C Common clean + $(MAKE) -C GUICommon clean + $(MAKE) -C DStarRepeater -f MakefileGUI clean + $(MAKE) -C DStarRepeaterConfig clean diff --git a/MakefileGUIPi b/MakefileGUIPi index 201a0e0..8cd243c 100644 --- a/MakefileGUIPi +++ b/MakefileGUIPi @@ -12,25 +12,25 @@ export LDFLAGS := all: DStarRepeater/dstarrepeater DStarRepeaterConfig/dstarrepeaterconfig DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeater -f MakefileGUI + $(MAKE) -C DStarRepeater -f MakefileGUI DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a - make -C DStarRepeaterConfig + $(MAKE) -C DStarRepeaterConfig GUICommon/GUICommon.a: - make -C GUICommon + $(MAKE) -C GUICommon Common/Common.a: - make -C Common + $(MAKE) -C Common install: all - make -C Data install - make -C DStarRepeater -f MakefileGUI install - make -C DStarRepeaterConfig install + $(MAKE) -C Data install + $(MAKE) -C DStarRepeater -f MakefileGUI install + $(MAKE) -C DStarRepeaterConfig install clean: - make -C Common clean - make -C GUICommon clean - make -C DStarRepeater clean - make -C DStarRepeaterConfig clean + $(MAKE) -C Common clean + $(MAKE) -C GUICommon clean + $(MAKE) -C DStarRepeater clean + $(MAKE) -C DStarRepeaterConfig clean From cbf40eb482a34d6e0e7c81462c6707fefd67c840 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck F4FXL - KC3FRA Date: Tue, 13 Nov 2018 21:02:33 +0100 Subject: [PATCH 2/2] Added dependencies check --- Common/Makefile | 5 +++++ DStarRepeater/Makefile | 8 +++++++- DStarRepeater/MakefileGUI | 8 +++++++- DStarRepeaterConfig/Makefile | 10 +++++++++- GUICommon/Makefile | 5 +++++ Makefile | 14 ++++++++++---- Makefile.Pi | 13 +++++++++---- MakefileGUI | 13 +++++++++---- MakefileGUIPi | 13 +++++++++---- 9 files changed, 70 insertions(+), 19 deletions(-) diff --git a/Common/Makefile b/Common/Makefile index 82950b9..3539288 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -7,14 +7,19 @@ OBJECTS = AMBEFEC.o AnnouncementUnit.o ArduinoController.o BeaconUnit.o Callsign SlowDataDecoder.o SlowDataEncoder.o SoundCardController.o SoundCardReaderWriter.o SplitController.o TCPReaderWriter.o \ Timer.o UDPReaderWriter.o UDRCController.o URIUSBController.o Utils.o +.PHONY: all all: Common.a Common.a: $(OBJECTS) $(AR) rcs Common.a $(OBJECTS) +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) -DwxUSE_GUI=0 $(CFLAGS) -c -o $@ $< + $(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) $< > $*.d +.PHONY: clean clean: $(RM) Common.a *.o *.d *.bak *~ diff --git a/DStarRepeater/Makefile b/DStarRepeater/Makefile index bfc7826..8f65cf9 100644 --- a/DStarRepeater/Makefile +++ b/DStarRepeater/Makefile @@ -1,17 +1,23 @@ OBJECTS = DStarRepeaterApp.o DStarRepeaterLogRedirect.o DStarRepeaterRXThread.o DStarRepeaterStatusData.o \ DStarRepeaterThread.o DStarRepeaterTRXThread.o DStarRepeaterTXRXThread.o DStarRepeaterTXThread.o +.PHONY: all all: dstarrepeaterd -dstarrepeaterd: $(OBJECTS) +dstarrepeaterd: $(OBJECTS) ../Common/Common.a $(CXX) $(OBJECTS) ../Common/Common.a $(LDFLAGS) $(LIBS) -o dstarrepeaterd +-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 dstarrepeaterd $(BINDIR) clean: $(RM) dstarrepeaterd *.o *.d *.bak *~ +../Common/Common.a: diff --git a/DStarRepeater/MakefileGUI b/DStarRepeater/MakefileGUI index aba746c..9df8212 100644 --- a/DStarRepeater/MakefileGUI +++ b/DStarRepeater/MakefileGUI @@ -3,15 +3,21 @@ OBJECTS = DStarRepeaterApp.o DStarRepeaterFrame.o DStarRepeaterLogRedirect.o DSt all: dstarrepeater -dstarrepeater: $(OBJECTS) +dstarrepeater: $(OBJECTS) ../Common/Common.a ../GUICommon/GUICommon.a $(CXX) $(OBJECTS) ../Common/Common.a ../GUICommon/GUICommon.a $(LDFLAGS) $(GUILIBS) -o dstarrepeater %.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 dstarrepeater $(BINDIR) +.PHONY: clean clean: $(RM) dstarrepeater *.o *.d *.bak *~ +../Common/Common.a: +../GUICommon/GUICommon.a: + diff --git a/DStarRepeaterConfig/Makefile b/DStarRepeaterConfig/Makefile index 588f005..b74b9e5 100644 --- a/DStarRepeaterConfig/Makefile +++ b/DStarRepeaterConfig/Makefile @@ -5,17 +5,25 @@ OBJECTS = DStarRepeaterConfigActiveHangSet.o DStarRepeaterConfigAnnouncementSet. DStarRepeaterConfigIcomSet.o DStarRepeaterConfigMMDVMSet.o DStarRepeaterConfigModemSet.o DStarRepeaterConfigNetworkSet.o \ DStarRepeaterConfigSoundCardSet.o DStarRepeaterConfigSplitSet.o DStarRepeaterConfigTimesSet.o +.PHONY: all all: dstarrepeaterconfig -dstarrepeaterconfig: $(OBJECTS) +dstarrepeaterconfig: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a $(LDFLAGS) $(GUILIBS) -o dstarrepeaterconfig +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) $(CFLAGS) -I../GUICommon -I../Common -c -o $@ $< + $(CXX) -MM $(CFLAGS) -I../GUICommon -I../Common $< > $*.d +.PHONY: install install: install -g bin -o root -m 0775 dstarrepeaterconfig $(BINDIR) +.PHONY: install clean: $(RM) dstarrepeaterconfig *.o *.d *.bak *~ +../GUICommon/GUICommon.a: +../Common/Common.a: diff --git a/GUICommon/Makefile b/GUICommon/Makefile index cd9a158..7c7c0c9 100644 --- a/GUICommon/Makefile +++ b/GUICommon/Makefile @@ -1,13 +1,18 @@ OBJECTS = AddressTextCtrl.o CallsignTextCtrl.o MessageTextCtrl.o PortTextCtrl.o RestrictedTextCtrl.o +.PHONY: all all: GUICommon.a GUICommon.a: $(OBJECTS) $(AR) rcs GUICommon.a $(OBJECTS) +-include $(OBJECTS:.o=.d) + %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< + $(CXX) -MM $(CFLAGS) $< > $*.d +.PHONY: clean clean: $(RM) GUICommon.a *.o *.d *.bak *~ diff --git a/Makefile b/Makefile index b14327a..993212e 100644 --- a/Makefile +++ b/Makefile @@ -11,26 +11,32 @@ export LDFLAGS := all: DStarRepeater/dstarrepeaterd DStarRepeaterConfig/dstarrepeaterconfig -DStarRepeater/dstarrepeaterd: Common/Common.a +DStarRepeater/dstarrepeaterd: Common/Common.a force $(MAKE) -C DStarRepeater -DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a +DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeaterConfig -GUICommon/GUICommon.a: +GUICommon/GUICommon.a: force $(MAKE) -C GUICommon -Common/Common.a: +Common/Common.a: force $(MAKE) -C Common +.PHONY: install install: all $(MAKE) -C Data install $(MAKE) -C DStarRepeater install $(MAKE) -C DStarRepeaterConfig install +.PHONY: clean clean: $(MAKE) -C Common clean $(MAKE) -C GUICommon clean $(MAKE) -C DStarRepeater clean $(MAKE) -C DStarRepeaterConfig clean +.PHONY: force +force: + @true + diff --git a/Makefile.Pi b/Makefile.Pi index 1fd706f..951c283 100644 --- a/Makefile.Pi +++ b/Makefile.Pi @@ -11,26 +11,31 @@ export LDFLAGS := all: DStarRepeater/dstarrepeaterd DStarRepeaterConfig/dstarrepeaterconfig -DStarRepeater/dstarrepeaterd: Common/Common.a +DStarRepeater/dstarrepeaterd: Common/Common.a force $(MAKE) -C DStarRepeater -DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a +DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeaterConfig -GUICommon/GUICommon.a: +GUICommon/GUICommon.a: force $(MAKE) -C GUICommon -Common/Common.a: +Common/Common.a: force $(MAKE) -C Common +.PHONY: install: all $(MAKE) -C Data install $(MAKE) -C DStarRepeater install $(MAKE) -C DStarRepeaterConfig install +.PHONY: clean clean: $(MAKE) -C Common clean $(MAKE) -C GUICommon clean $(MAKE) -C DStarRepeater clean $(MAKE) -C DStarRepeaterConfig clean +.PHONY: force +force: + @true diff --git a/MakefileGUI b/MakefileGUI index 1b2bfe8..67f33ff 100644 --- a/MakefileGUI +++ b/MakefileGUI @@ -11,26 +11,31 @@ export LDFLAGS := all: DStarRepeater/dstarrepeater DStarRepeaterConfig/dstarrepeaterconfig -DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a +DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeater -f MakefileGUI -DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a +DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeaterConfig -GUICommon/GUICommon.a: +GUICommon/GUICommon.a: force $(MAKE) -C GUICommon -Common/Common.a: +Common/Common.a: force $(MAKE) -C Common +.PHONY: install install: all $(MAKE) -C Data install $(MAKE) -C DStarRepeater -f MakefileGUI install $(MAKE) -C DStarRepeaterConfig install +.PHONY: clean clean: $(MAKE) -C Common clean $(MAKE) -C GUICommon clean $(MAKE) -C DStarRepeater -f MakefileGUI clean $(MAKE) -C DStarRepeaterConfig clean +.PHONY: force +force: + @true diff --git a/MakefileGUIPi b/MakefileGUIPi index 8cd243c..b6f2834 100644 --- a/MakefileGUIPi +++ b/MakefileGUIPi @@ -11,26 +11,31 @@ export LDFLAGS := all: DStarRepeater/dstarrepeater DStarRepeaterConfig/dstarrepeaterconfig -DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a +DStarRepeater/dstarrepeater: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeater -f MakefileGUI -DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a +DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a force $(MAKE) -C DStarRepeaterConfig -GUICommon/GUICommon.a: +GUICommon/GUICommon.a: force $(MAKE) -C GUICommon -Common/Common.a: +Common/Common.a: force $(MAKE) -C Common +.PHONY: install install: all $(MAKE) -C Data install $(MAKE) -C DStarRepeater -f MakefileGUI install $(MAKE) -C DStarRepeaterConfig install +.PHONY: clean clean: $(MAKE) -C Common clean $(MAKE) -C GUICommon clean $(MAKE) -C DStarRepeater clean $(MAKE) -C DStarRepeaterConfig clean +.PHONY: force +force: + @true