blob: 1e669be8385d42445b296ecee3a87b6a6942d9e7 [file] [log] [blame]
Yue Lun03a82d92013-10-21 10:15:02 +08001include ./config
2
3ifndef PRJ_PATH
4 PRJ_PATH=$(shell pwd)
5endif
6export PRJ_PATH
7
8include ./make/config.mk
9include ./make/tools.mk
10include ./make/$(OS)_opt.mk
11
12SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile)))
13SUB_LIB=$(subst src/, , $(SUB_DIR))
14
15all: $(BIN_DIR) kslib uslib shell
16 mkdir -p ./temp/;cd ./temp;cp ../build/bin/ssdk_ks_km.a ./;ar -x ssdk_ks_km.a; cp ../ko_Makefile ./Makefile;
Yue Lun64056562013-10-30 18:02:43 +080017 make -C $(SYS_PATH) M=$(PRJ_PATH)/temp/ CROSS_COMPILE=$(TOOLPREFIX) modules
18 cp temp/*.ko build/bin;
19 rm -Rf ./temp
Yue Lun03a82d92013-10-21 10:15:02 +080020 @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
21
22kslib:kslib_o
23 $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o)
24
25kslib_o:
26 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i all || exit 1;)
27
28uslib:uslib_o
29 $(AR) -r $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/USLIB/*.o)
30
31uslib_o:
32 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=USLIB -C src/$i all || exit 1;)
33
34shell:uslib shell_o
35 $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ)
36 $(STRIP) $(BIN_DIR)/$(SHELLOBJ)
37
38shell_o:
39 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;)
40
41$(BIN_DIR):
42 $(MKDIR) -p $@
43
44release:
45 @cd make; ./release.sh $(VER)
46
47clean:
48 $(RM) -f $(BLD_DIR)/KSLIB/*
49 $(RM) -f $(BLD_DIR)/USLIB/*
50 $(RM) -f $(BLD_DIR)/SHELL/*
51 $(RM) -f $(BIN_DIR)/*