luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 1 | include ./config |
| 2 | |
| 3 | ifndef PRJ_PATH |
| 4 | PRJ_PATH=$(shell pwd) |
| 5 | endif |
| 6 | export PRJ_PATH |
| 7 | |
| 8 | include ./make/config.mk |
| 9 | include ./make/tools.mk |
| 10 | include ./make/$(OS)_opt.mk |
| 11 | |
| 12 | SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile))) |
| 13 | SUB_LIB=$(subst src/, , $(SUB_DIR)) |
| 14 | |
| 15 | all: $(BIN_DIR) uslib shell |
| 16 | @echo "---Build [SSDK_SH-$(VERSION)] at $(BUILD_DATE) finished." |
| 17 | |
| 18 | kslib:kslib_o |
| 19 | $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o) |
| 20 | |
| 21 | kslib_o: |
| 22 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i all || exit 1;) |
| 23 | |
| 24 | uslib:uslib_o |
| 25 | $(AR) -r $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/USLIB/*.o) |
| 26 | |
| 27 | uslib_o: |
| 28 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=USLIB -C src/$i all || exit 1;) |
| 29 | |
| 30 | shell:uslib shell_o |
| 31 | $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ) |
| 32 | $(STRIP) $(BIN_DIR)/$(SHELLOBJ) |
| 33 | |
| 34 | shell_o: |
| 35 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;) |
| 36 | |
| 37 | $(BIN_DIR): |
| 38 | $(MKDIR) -p $@ |
| 39 | |
| 40 | release: |
| 41 | @cd make; ./release.sh $(VER) |
| 42 | |
| 43 | clean: |
| 44 | $(RM) -f $(BLD_DIR)/KSLIB/* |
| 45 | $(RM) -f $(BLD_DIR)/USLIB/* |
| 46 | $(RM) -f $(BLD_DIR)/SHELL/* |
| 47 | $(RM) -f $(BIN_DIR)/* |