-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (105 loc) · 3.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#############################################################
# Required variables for each makefile
# Discard this section from all parent makefiles
# Expected variables (with automatic defaults):
# CSRCS (all "C" files in the dir)
# SUBDIRS (all subdirs with a Makefile)
# GEN_LIBS - list of libs to be generated ()
# GEN_IMAGES - list of object file images to be generated ()
# GEN_BINS - list of binaries to be generated ()
# COMPONENTS_xxx - a list of libs/objs in the form
# subdir/lib to be extracted and rolled up into
# a generated lib/image xxx.a ()
#
TOP_DIR:=./
sinclude $(TOP_DIR)/tools/tool_chain.def
TARGET = w600
USE_LIB=1
#EXTRA_CCFLAGS += -u
ifndef PDIR # {
GEN_IMAGES= $(TARGET).out
GEN_BINS = $(TARGET).bin
SUBDIRS = \
$(TOP_DIR)/app \
$(TOP_DIR)/demo \
$(TOP_DIR)/platform/boot/$(COMPILE)
endif # } PDIR
ifndef PDIR # {
ifeq ($(USE_LIB), 0)
SUBDIRS += \
$(TOP_DIR)/platform/common \
$(TOP_DIR)/platform/drivers \
$(TOP_DIR)/platform/sys \
$(TOP_DIR)/src/network \
$(TOP_DIR)/src/os \
$(TOP_DIR)/src/app
endif
endif
COMPONENTS_$(TARGET) = \
$(TOP_DIR)/platform/boot/$(COMPILE)/startup.o \
$(TOP_DIR)/platform/boot/$(COMPILE)/misc.o \
$(TOP_DIR)/platform/boot/$(COMPILE)/retarget.o \
$(TOP_DIR)/app/libuser$(LIB_EXT) \
$(TOP_DIR)/demo/libdemo$(LIB_EXT)
ifeq ($(USE_LIB), 0)
COMPONENTS_$(TARGET) += \
$(TOP_DIR)/platform/common/libcommon$(LIB_EXT) \
$(TOP_DIR)/platform/drivers/libdrivers$(LIB_EXT) \
$(TOP_DIR)/platform/sys/libsys$(LIB_EXT) \
$(TOP_DIR)/src/network/libnetwork$(LIB_EXT) \
$(TOP_DIR)/src/os/libos$(LIB_EXT) \
$(TOP_DIR)/src/app/libapp$(LIB_EXT)
endif
LINKLIB = \
$(TOP_DIR)/lib/libwlan$(LIB_EXT) \
$(TOP_DIR)/lib/libairkiss_log$(LIB_EXT)
ifeq ($(USE_LIB), 1)
LINKLIB += \
$(TOP_DIR)/lib/libcommon$(LIB_EXT) \
$(TOP_DIR)/lib/libdrivers$(LIB_EXT) \
$(TOP_DIR)/lib/libsys$(LIB_EXT) \
$(TOP_DIR)/lib/libnetwork$(LIB_EXT) \
$(TOP_DIR)/lib/libos$(LIB_EXT) \
$(TOP_DIR)/lib/libapp$(LIB_EXT)
endif
ifeq ($(COMPILE), gcc)
LINKFLAGS_$(TARGET) = \
$(LINKLIB) \
-T$(LD_FILE) \
-Wl,-warn-common
else
LINKFLAGS_$(TARGET) = \
--library_type=microlib \
$(LINKLIB) \
--strict --scatter $(LD_FILE)
endif
#############################################################
# Configuration i.e. compile options etc.
# Target specific stuff (defines etc.) goes in here!
# Generally values applying to a tree are captured in the
# makefile at its root level - these are then overridden
# for a subtree within the makefile rooted therein
#
CONFIGURATION_DEFINES = -DWM_W600
DEFINES += \
$(CONFIGURATION_DEFINES)
DDEFINES += \
$(CONFIGURATION_DEFINES)
#############################################################
# Recursion Magic - Don't touch this!!
#
# Each subtree potentially has an include directory
# corresponding to the common APIs applicable to modules
# rooted at that subtree. Accordingly, the INCLUDE PATH
# of a module can only contain the include directories up
# its parent path, and not its siblings
#
# Required for each makefile to inherit from the parent
#
INCLUDES := $(INCLUDES) -I$(PDIR)include
INCLUDES += -I ./
#PDIR := ../$(PDIR)
#sinclude $(PDIR)Makefile
sinclude $(TOP_DIR)/tools/rules.mk
.PHONY: FORCE
FORCE: