Updated top level makefile to include prog and lib level makefile logic.

This commit is contained in:
jakcron 2018-08-07 14:00:09 +08:00
parent 2c3753e2bd
commit 5b26c370da
3 changed files with 15 additions and 28 deletions

View file

@ -1,10 +0,0 @@
LIBS = libfnd libpolarssl liblz4 libcrypto libcompress libes libpki libhac libhac-hb
main: build
rebuild: clean build
build:
@$(foreach lib,$(LIBS), cd $(lib) && $(MAKE) && cd ..;)
clean:
@$(foreach lib,$(LIBS), cd $(lib) && $(MAKE) clean && cd ..;)

View file

@ -1,11 +1,22 @@
PROJECT_DIR = $(CURDIR)
LIB_DIR = $(PROJECT_DIR)/lib
PROGRAM_DIR = $(PROJECT_DIR)/programs
BIN_DIR = $(PROJECT_DIR)/bin
LIBS = libfnd libpolarssl liblz4 libcrypto libcompress libes libpki libhac libhac-hb
PROGS = nstool
main: build main: build
rebuild: clean build rebuild: clean build
build: build:
cd lib && $(MAKE) && cd .. mkdir -p $(BIN_DIR)
cd programs && $(MAKE) && cd .. @$(foreach lib,$(LIBS), cd $(LIB_DIR)/$(lib) && $(MAKE) && cd $(PROJECT_DIR);)
@$(foreach prog,$(PROGS), cd $(PROGRAM_DIR)/$(prog) && $(MAKE) && cd $(PROJECT_DIR) && cp -r $(PROGRAM_DIR)/$(prog)/bin/* $(BIN_DIR);)
clean: clean:
cd lib && $(MAKE) clean && cd .. rm -rf $(BIN_DIR)
cd programs && $(MAKE) clean && cd .. @$(foreach lib,$(LIBS), cd $(LIB_DIR)/$(lib) && $(MAKE) clean && cd $(PROJECT_DIR);)
@$(foreach prog,$(PROGS), cd $(PROGRAM_DIR)/$(prog) && $(MAKE) clean && cd $(PROJECT_DIR);)

View file

@ -1,14 +0,0 @@
PROGS = nstool
BIN_DIR = "../bin"
main: build
rebuild: clean build
build:
mkdir -p $(BIN_DIR)
@$(foreach prog,$(PROGS), cd $(prog) && $(MAKE) && cd .. && cp -r $(prog)/bin/* $(BIN_DIR);)
clean:
@$(foreach prog,$(PROGS), cd $(prog) && $(MAKE) clean && cd ..;)
rm -rf $(BIN_DIR)