blob: adcf87282453373ce62b11751438905aa5bb108d [file] [log] [blame]
luny479178a2014-06-18 12:33:29 +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) uslib shell
16 @echo "---Build [SSDK_SH-$(VERSION)] at $(BUILD_DATE) finished."
17
18kslib:kslib_o
19 $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o)
20
21kslib_o:
22 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i all || exit 1;)
23
24uslib:uslib_o
25 $(AR) -r $(BIN_DIR)/$(US_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/USLIB/*.o)
26
27uslib_o:
28 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=USLIB -C src/$i all || exit 1;)
29
30shell:uslib shell_o
31 $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ)
32 $(STRIP) $(BIN_DIR)/$(SHELLOBJ)
33
34shell_o:
35 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;)
36
37$(BIN_DIR):
38 $(MKDIR) -p $@
39
40release:
41 @cd make; ./release.sh $(VER)
42
43clean:
44 $(RM) -f $(BLD_DIR)/KSLIB/*
45 $(RM) -f $(BLD_DIR)/USLIB/*
46 $(RM) -f $(BLD_DIR)/SHELL/*
47 $(RM) -f $(BIN_DIR)/*