include variables.mk

TARGETS = Encryption Vocoder Transmitter Receiver UserInterface Modem p25

.PHONY: clean doc

all: $(TARGETS)
	@#echo Nothing to do for $@ ...

Encryption:
	@cd $(PROJ_DIR)/EncryptionDevice; make; sudo make install

Vocoder:
	@cd $(PROJ_DIR)/OveroVocoderDevice; make; sudo make install

Transmitter:
	@cd $(PROJ_DIR)/p25_Transmitter; make; sudo make install

Receiver:
	@cd $(PROJ_DIR)/p25_Receiver; make; sudo make install

UserInterface:
	@cd $(PROJ_DIR)/UserInterfaceDevice; make; sudo make install

Modem:
	@cd $(PROJ_DIR)/ModemDevice; make; sudo make install

p25:
	@cd $(PROJ_DIR)/p25_ossie_overo; make; sudo make install

doc: 
	@echo Running Doxygen ...
	@mkdir -p $(DOC_DIR)
	cd $(PROJ_DIR)/EncryptionDevice; doxygen;
	cd $(PROJ_DIR)/OveroVocoderDevice; doxygen;
	cd $(PROJ_DIR)/p25_Transmitter; doxygen;
	cd $(PROJ_DIR)/p25_Receiver; doxygen;
	cd $(PROJ_DIR)/UserInterfaceDevice; doxygen;
	cd $(PROJ_DIR)/ModemDevice; doxygen;

configure:
	@cd $(PROJ_DIR)/EncryptionDevice; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/OveroVocoderDevice; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/p25_Transmitter; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/p25_Receiver; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/UserInterfaceDevice; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/ModemDevice; ./configure CPPFLAGS=$(CPPFLAGS)
	@cd $(PROJ_DIR)/p25_ossie_overo; ./configure CPPFLAGS=$(CPPFLAGS)

cleanall: clean 
	@cd $(DOC_DIR); rm -rf html latex

clean: 
	@cd $(PROJ_DIR)/EncryptionDevice; make clean
	@cd $(PROJ_DIR)/OveroVocoderDevice; make clean
	@cd $(PROJ_DIR)/p25_Transmitter; make clean
	@cd $(PROJ_DIR)/p25_Receiver; make clean
	@cd $(PROJ_DIR)/UserInterfaceDevice; make clean
	@cd $(PROJ_DIR)/ModemDevice; make clean
	@cd $(PROJ_DIR)/p25_ossie_overo; make clean
