blob: c8961bc066ec9e4e692f2f7323f83f7e61d745d5 [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
Kyle Swenson2cf39532021-01-26 13:28:03 -070015all: $(BIN_DIR) shell
luny479178a2014-06-18 12:33:29 +080016 @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
Kyle Swenson2cf39532021-01-26 13:28:03 -070030shell:shell_o
31 @echo "--------====== Building ssdk shell ========----------"
luny479178a2014-06-18 12:33:29 +080032 $(CP) $(BLD_DIR)/SHELL/$(SHELLOBJ) $(BIN_DIR)/$(SHELLOBJ)
33 $(STRIP) $(BIN_DIR)/$(SHELLOBJ)
34
Kyle Swenson2cf39532021-01-26 13:28:03 -070035shell_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
luny479178a2014-06-18 12:33:29 +080039 $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=SHELL -C src/$i all || exit 1;)
40
41$(BIN_DIR):
42 $(MKDIR) -p $@
43
Kyle Swenson2cf39532021-01-26 13:28:03 -070044install: shell
45 mkdir -p $(DESTDIR)/usr/bin
46 $(CP) $(BIN_DIR)/$(SHELLOBJ) $(DESTDIR)/usr/bin
47
luny479178a2014-06-18 12:33:29 +080048release:
49 @cd make; ./release.sh $(VER)
50
51clean:
52 $(RM) -f $(BLD_DIR)/KSLIB/*
53 $(RM) -f $(BLD_DIR)/USLIB/*
54 $(RM) -f $(BLD_DIR)/SHELL/*
55 $(RM) -f $(BIN_DIR)/*