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 | |
Kyle Swenson | 2cf3953 | 2021-01-26 13:28:03 -0700 | [diff] [blame] | 15 | all: $(BIN_DIR) shell |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 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 | |
Kyle Swenson | 2cf3953 | 2021-01-26 13:28:03 -0700 | [diff] [blame] | 30 | shell:shell_o |
| 31 | @echo "--------====== Building ssdk shell ========----------" |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 32 | $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ) |
| 33 | $(STRIP) $(BIN_DIR)/$(SHELLOBJ) |
| 34 | |
Kyle Swenson | 2cf3953 | 2021-01-26 13:28:03 -0700 | [diff] [blame] | 35 | shell_o:uslib |
| 36 | # Cradlepoint : this may/may not be needed, |
| 37 | # There have been incidences of this dir not existing before being used |
| 38 | $(MKDIR) -p $(BLD_DIR)/SHELL |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 39 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;) |
| 40 | |
| 41 | $(BIN_DIR): |
| 42 | $(MKDIR) -p $@ |
| 43 | |
Kyle Swenson | 2cf3953 | 2021-01-26 13:28:03 -0700 | [diff] [blame] | 44 | install: shell |
| 45 | mkdir -p $(DESTDIR)/usr/bin |
| 46 | $(CP) $(BIN_DIR)/$(SHELLOBJ) $(DESTDIR)/usr/bin |
| 47 | |
luny | 479178a | 2014-06-18 12:33:29 +0800 | [diff] [blame] | 48 | release: |
| 49 | @cd make; ./release.sh $(VER) |
| 50 | |
| 51 | clean: |
| 52 | $(RM) -f $(BLD_DIR)/KSLIB/* |
| 53 | $(RM) -f $(BLD_DIR)/USLIB/* |
| 54 | $(RM) -f $(BLD_DIR)/SHELL/* |
| 55 | $(RM) -f $(BIN_DIR)/* |