Yue Lun | 03a82d9 | 2013-10-21 10:15:02 +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 | |
Zou Shunxiang | 4c786c9 | 2014-01-21 16:02:33 +0800 | [diff] [blame] | 15 | all: $(BIN_DIR) kslib |
Yue Lun | 03a82d9 | 2013-10-21 10:15:02 +0800 | [diff] [blame] | 16 | mkdir -p ./temp/;cd ./temp;cp ../build/bin/ssdk_ks_km.a ./;ar -x ssdk_ks_km.a; cp ../ko_Makefile ./Makefile; |
Yue Lun | 6405656 | 2013-10-30 18:02:43 +0800 | [diff] [blame] | 17 | make -C $(SYS_PATH) M=$(PRJ_PATH)/temp/ CROSS_COMPILE=$(TOOLPREFIX) modules |
| 18 | cp temp/*.ko build/bin; |
xiaofeis | b4ed35a | 2014-10-16 14:26:52 +0800 | [diff] [blame] | 19 | rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a |
Yue Lun | 03a82d9 | 2013-10-21 10:15:02 +0800 | [diff] [blame] | 20 | @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished." |
| 21 | |
| 22 | kslib:kslib_o |
| 23 | $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o) |
| 24 | |
| 25 | kslib_o: |
| 26 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i all || exit 1;) |
| 27 | |
| 28 | uslib:uslib_o |
| 29 | $(AR) -r $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/USLIB/*.o) |
| 30 | |
| 31 | uslib_o: |
| 32 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=USLIB -C src/$i all || exit 1;) |
| 33 | |
| 34 | shell:uslib shell_o |
| 35 | $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ) |
| 36 | $(STRIP) $(BIN_DIR)/$(SHELLOBJ) |
| 37 | |
| 38 | shell_o: |
| 39 | $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;) |
| 40 | |
| 41 | $(BIN_DIR): |
| 42 | $(MKDIR) -p $@ |
| 43 | |
| 44 | release: |
| 45 | @cd make; ./release.sh $(VER) |
| 46 | |
| 47 | clean: |
| 48 | $(RM) -f $(BLD_DIR)/KSLIB/* |
| 49 | $(RM) -f $(BLD_DIR)/USLIB/* |
| 50 | $(RM) -f $(BLD_DIR)/SHELL/* |
| 51 | $(RM) -f $(BIN_DIR)/* |