-
Notifications
You must be signed in to change notification settings - Fork 32
/
reliance.mk
207 lines (186 loc) · 9 KB
/
reliance.mk
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
##
# Objects and rules for building Reliance Edge.
##
# If P_OS is unset, default to the host operating system
ifndef P_OS
ifeq ($(B_HOSTOS),windows)
P_OS=win32
else ifneq ($(B_HOSTOS),)
P_OS=$(B_HOSTOS)
endif
endif
##
# Part 0 - include directories.
##
# Include directories needed by the file system driver.
#
# P_PROJDIR must be listed first: this allows projects to override headers such
# as redostypes.h.
REDDRIVINC=\
$(B_CINCCMD) $(P_PROJDIR) \
$(B_CINCCMD) $(P_BASEDIR)/include \
$(B_CINCCMD) $(P_BASEDIR)/core/include \
$(B_CINCCMD) $(P_BASEDIR)/os/$(P_OS)/include
# Additional include directories needed by the file system tests.
REDTESTINC=\
$(B_CINCCMD) $(P_BASEDIR)/tests/testfw \
$(B_CINCCMD) $(P_BASEDIR)/tests/stochposix
REDALLINC=$(REDDRIVINC) $(REDTESTINC)
##
# Part 1 - the object files.
##
# Objects necessary (in some configuration) to build the file system driver.
REDDRIVOBJ=\
$(P_BASEDIR)/bdev/bdev.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/blockio.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/buffer.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/buffercmn.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/core.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/dir.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/format.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/imap.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/imapextern.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/imapinline.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/inode.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/inodedata.$(B_OBJEXT) \
$(P_BASEDIR)/core/driver/volume.$(B_OBJEXT) \
$(P_BASEDIR)/fse/fse.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osassert.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osbdev.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osclock.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osmutex.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osoutput.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/ostask.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/ostimestamp.$(B_OBJEXT) \
$(P_BASEDIR)/os/$(P_OS)/services/osuidgid.$(B_OBJEXT) \
$(P_BASEDIR)/posix/path.$(B_OBJEXT) \
$(P_BASEDIR)/posix/posix.$(B_OBJEXT) \
$(P_BASEDIR)/util/bitmap.$(B_OBJEXT) \
$(P_BASEDIR)/util/crc.$(B_OBJEXT) \
$(P_BASEDIR)/util/ftype.$(B_OBJEXT) \
$(P_BASEDIR)/util/memory.$(B_OBJEXT) \
$(P_BASEDIR)/util/namelen.$(B_OBJEXT) \
$(P_BASEDIR)/util/perm.$(B_OBJEXT) \
$(P_BASEDIR)/util/sign.$(B_OBJEXT) \
$(P_BASEDIR)/util/string.$(B_OBJEXT) \
$(P_PROJDIR)/redconf.$(B_OBJEXT)
# Additional objects necessary to build the host tools.
REDTOOLOBJ=\
$(P_BASEDIR)/tools/getopt.$(B_OBJEXT) \
$(P_BASEDIR)/tools/toolcmn.$(B_OBJEXT) \
$(P_BASEDIR)/util/endian.$(B_OBJEXT)
# Additional objects necessary to build the tests.
REDTESTOBJ=\
$(P_BASEDIR)/tools/getopt.$(B_OBJEXT) \
$(P_BASEDIR)/tools/toolcmn.$(B_OBJEXT) \
$(P_BASEDIR)/tests/posix/fmtopt.$(B_OBJEXT) \
$(P_BASEDIR)/tests/util/atoi.$(B_OBJEXT) \
$(P_BASEDIR)/tests/util/math.$(B_OBJEXT) \
$(P_BASEDIR)/tests/util/printf.$(B_OBJEXT) \
$(P_BASEDIR)/tests/util/rand.$(B_OBJEXT)
REDTESTOBJ = \
$(P_BASEDIR)/tests/posix/fsstress.$(B_OBJEXT)
# The "sort" function is being used only for its side-effect of removing
# duplicates. A few object files are listed in more than one of these three
# variables, but duplicates in REDALLOBJ are an issue when this makefile is
# used in certain end-user build environments.
REDALLOBJ=$(sort $(REDDRIVOBJ) $(REDTESTOBJ) $(REDTOOLOBJ))
##
# Part 2 - the compilation rules.
##
ifndef REDPROJHDR
REDPROJHDR=
endif
REDHDR=\
$(P_BASEDIR)/include/redapimacs.h \
$(P_BASEDIR)/include/redbdev.h \
$(P_BASEDIR)/include/redcoreapi.h \
$(P_BASEDIR)/include/rederrno.h \
$(P_BASEDIR)/include/redexclude.h \
$(P_BASEDIR)/include/redformat.h \
$(P_BASEDIR)/include/redfs.h \
$(P_BASEDIR)/include/redfse.h \
$(P_BASEDIR)/include/redgetopt.h \
$(P_BASEDIR)/include/redmacs.h \
$(P_BASEDIR)/include/redmisc.h \
$(P_BASEDIR)/include/redosserv.h \
$(P_BASEDIR)/include/redposix.h \
$(P_BASEDIR)/include/redstat.h \
$(P_BASEDIR)/include/redtests.h \
$(P_BASEDIR)/include/redtestutils.h \
$(P_BASEDIR)/include/redtoolcmn.h \
$(P_BASEDIR)/include/redtransact.h \
$(P_BASEDIR)/include/redutils.h \
$(P_BASEDIR)/include/redver.h \
$(P_BASEDIR)/include/redvolume.h \
$(P_BASEDIR)/os/$(P_OS)/include/redostypes.h \
$(P_BASEDIR)/os/$(P_OS)/include/redosconf.h \
$(P_PROJDIR)/redconf.h \
$(P_PROJDIR)/redtypes.h \
$(REDPROJHDR)
REDCOREHDR=\
$(REDHDR) \
$(P_BASEDIR)/core/include/redcore.h \
$(P_BASEDIR)/core/include/redcoremacs.h \
$(P_BASEDIR)/core/include/redcorevol.h \
$(P_BASEDIR)/core/include/rednodes.h
$(P_BASEDIR)/bdev/bdev.$(B_OBJEXT): $(P_BASEDIR)/bdev/bdev.c $(REDHDR)
$(P_BASEDIR)/core/driver/blockio.$(B_OBJEXT): $(P_BASEDIR)/core/driver/blockio.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/buffer.$(B_OBJEXT): $(P_BASEDIR)/core/driver/buffer.c $(REDCOREHDR) $(P_BASEDIR)/core/driver/redbufferpriv.h
$(P_BASEDIR)/core/driver/buffercmn.$(B_OBJEXT): $(P_BASEDIR)/core/driver/buffercmn.c $(REDCOREHDR) $(P_BASEDIR)/core/driver/redbufferpriv.h
$(P_BASEDIR)/core/driver/core.$(B_OBJEXT): $(P_BASEDIR)/core/driver/core.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/dir.$(B_OBJEXT): $(P_BASEDIR)/core/driver/dir.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/format.$(B_OBJEXT): $(P_BASEDIR)/core/driver/format.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/imap.$(B_OBJEXT): $(P_BASEDIR)/core/driver/imap.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/imapextern.$(B_OBJEXT): $(P_BASEDIR)/core/driver/imapextern.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/imapinline.$(B_OBJEXT): $(P_BASEDIR)/core/driver/imapinline.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/inode.$(B_OBJEXT): $(P_BASEDIR)/core/driver/inode.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/inodedata.$(B_OBJEXT): $(P_BASEDIR)/core/driver/inodedata.c $(REDCOREHDR)
$(P_BASEDIR)/core/driver/volume.$(B_OBJEXT): $(P_BASEDIR)/core/driver/volume.c $(REDCOREHDR)
$(P_BASEDIR)/fse/fse.$(B_OBJEXT): $(P_BASEDIR)/fse/fse.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osassert.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osassert.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osbdev.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osbdev.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osclock.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osclock.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osmutex.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osmutex.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osoutput.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osoutput.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/ostask.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/ostask.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/ostimestamp.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/ostimestamp.c $(REDHDR)
$(P_BASEDIR)/os/$(P_OS)/services/osuidgid.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/services/osuidgid.c $(REDHDR)
$(P_BASEDIR)/posix/path.$(B_OBJEXT): $(P_BASEDIR)/posix/path.c $(REDHDR) $(P_BASEDIR)/include/redpath.h
$(P_BASEDIR)/posix/posix.$(B_OBJEXT): $(P_BASEDIR)/posix/posix.c $(REDHDR) $(P_BASEDIR)/include/redpath.h
$(P_BASEDIR)/tests/posix/fsstress.$(B_OBJEXT): $(P_BASEDIR)/tests/posix/fsstress.c $(REDHDR) $(P_BASEDIR)/tests/posix/redposixcompat.h
$(P_BASEDIR)/tests/posix/fmtopt.$(B_OBJEXT): $(P_BASEDIR)/tests/posix/fmtopt.c $(REDHDR)
$(P_BASEDIR)/tests/util/atoi.$(B_OBJEXT): $(P_BASEDIR)/tests/util/atoi.c $(REDHDR)
$(P_BASEDIR)/tests/util/math.$(B_OBJEXT): $(P_BASEDIR)/tests/util/math.c $(REDHDR)
$(P_BASEDIR)/tests/util/printf.$(B_OBJEXT): $(P_BASEDIR)/tests/util/printf.c $(REDHDR)
$(P_BASEDIR)/tests/util/rand.$(B_OBJEXT): $(P_BASEDIR)/tests/util/rand.c $(REDHDR)
$(P_BASEDIR)/tools/getopt.$(B_OBJEXT): $(P_BASEDIR)/tools/getopt.c $(REDHDR)
$(P_BASEDIR)/tools/toolcmn.$(B_OBJEXT): $(P_BASEDIR)/tools/toolcmn.c $(REDHDR)
$(P_BASEDIR)/util/bitmap.$(B_OBJEXT): $(P_BASEDIR)/util/bitmap.c $(REDHDR)
$(P_BASEDIR)/util/crc.$(B_OBJEXT): $(P_BASEDIR)/util/crc.c $(REDHDR)
$(P_BASEDIR)/util/endian.$(B_OBJEXT): $(P_BASEDIR)/util/endian.c $(REDHDR)
$(P_BASEDIR)/util/ftype.$(B_OBJEXT): $(P_BASEDIR)/util/ftype.c $(REDHDR)
$(P_BASEDIR)/util/memory.$(B_OBJEXT): $(P_BASEDIR)/util/memory.c $(REDHDR)
$(P_BASEDIR)/util/namelen.$(B_OBJEXT): $(P_BASEDIR)/util/namelen.c $(REDHDR)
$(P_BASEDIR)/util/perm.$(B_OBJEXT): $(P_BASEDIR)/util/perm.c $(REDHDR)
$(P_BASEDIR)/util/sign.$(B_OBJEXT): $(P_BASEDIR)/util/sign.c $(REDHDR)
$(P_BASEDIR)/util/string.$(B_OBJEXT): $(P_BASEDIR)/util/string.c $(REDHDR)
$(P_PROJDIR)/redconf.$(B_OBJEXT): $(P_PROJDIR)/redconf.c $(REDHDR)
##
# Part 3: supplemental compilation rules
# These are not included in REDALLOBJ but are used by some test projects.
##
$(P_BASEDIR)/tools/mditer.$(B_OBJEXT): $(P_BASEDIR)/tools/mditer.c $(REDHDR) $(P_BASEDIR)/include/redmditer.h
# OS name prefix used by the checker and formatter.
ifeq ($(P_OS),win32)
REDTOOLPREFIX=win
else ifeq ($(P_OS),linux)
REDTOOLPREFIX=linux
else
REDTOOLPREFIX=
endif
# Only host tools needed by test projects are here. Rules for the other host
# tools are in os/$(P_OS)/build/host.mk
ifneq ($(REDTOOLPREFIX),)
$(P_BASEDIR)/os/$(P_OS)/tools/$(REDTOOLPREFIX)fmt.$(B_OBJEXT): $(P_BASEDIR)/os/$(P_OS)/tools/$(REDTOOLPREFIX)fmt.c $(REDHDR)
endif