forked from open-power/capiflash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.linux.mk
450 lines (381 loc) · 14.3 KB
/
config.linux.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: config.linux.mk $
#
# IBM Data Engine for NoSQL - Power Systems Edition User Library Project
#
# Contributors Listed Below - COPYRIGHT 2014,2015
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
SHELL=/bin/bash
build:
${MAKE} cleanall
${MAKE} -j10 dep
${MAKE} -j10 code_pass
${MAKE} -j10 test
${MAKE} docs
${MAKE} packaging
ship:
${MAKE} -j10 dep
${MAKE} -j10 code_pass
@if [[ $(notdir $(PWD)) = test ]]; then ${MAKE} test; fi
tests:
${MAKE} -j10 ship
${MAKE} -j10 test
run_fvt:
${MAKE} -j10 tests
${MAKE} fvt
run_unit:
${MAKE} -j10 tests
${MAKE} unit
#needed to provide linker rpath hints for installed code
DEFAULT_LIB_INSTALL_PATH = /opt/ibm/capikv/lib
#generate VPATH based on these dirs.
VPATH_DIRS=. ${ROOTPATH}/src/common ${ROOTPATH}/obj/lib/ ${ROOTPATH}/img
#generate the VPATH, subbing :'s for spaces
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
VPATH += $(subst $(SPACE),:,$(VPATH_DIRS))
## output libs, objs for userdetails parsers
UD_DIR = ${ROOTPATH}/obj/modules/userdetails
UD_OBJS = ${UD_DIR}*.o ${UD_DIR}/*.so ${UD_DIR}/*.a
PGMDIR = ${ROOTPATH}/obj/programs
TESTDIR = ${ROOTPATH}/obj/tests
GENDIR = ${ROOTPATH}/obj/genfiles
IMGDIR = ${ROOTPATH}/img
PKGDIR = ${ROOTPATH}/pkg
GTESTDIR = src/test/framework/googletest/googletest
GTESTINC = ${GTESTDIR}/include
ifdef MODULE
OBJDIR = ${ROOTPATH}/obj/modules/${MODULE}
BEAMDIR = ${ROOTPATH}/obj/beam/${MODULE}
EXTRACOMMONFLAGS += -fPIC
ifdef STRICT
EXTRACOMMONFLAGS += -Weffc++
endif
CUSTOMFLAGS += -D__SURELOCK_MODULE=${MODULE}
#For AIX use the following istead.
#CUSTOMFLAGS += -D_AIX -D__SURELOCK_MODULE=${MODULE}
LIBS += $(addsuffix .so, $(addprefix lib, ${MODULE}))
EXTRAINCDIR += ${GENDIR} ${CURDIR}
else
OBJDIR = ${ROOTPATH}/obj/surelock
BEAMDIR = ${ROOTPATH}/obj/beam/surelock
EXTRAINCDIR += ${GENDIR} ${CURDIR}
endif
__internal__comma= ,
__internal__empty=
__internal__space=$(__internal__empty) $(__internal__empty)
MAKE_SPACE_LIST = $(subst $(__internal__comma),$(__internal__space),$(1))
ifdef SURELOCK_DEBUG
ifeq ($(SURELOCK_DEBUG),1)
CUSTOMFLAGS += -DSURELOCK_DEBUG=1
endif
endif
ifeq ($(USE_ADVANCED_TOOLCHAIN),yes)
CC_RAW = gcc
CXX_RAW = g++
CC = ${JAIL} ${ADV_TOOLCHAIN_PATH}/bin/${CC_RAW}
CXX = ${JAIL} ${ADV_TOOLCHAIN_PATH}/bin/${CXX_RAW}
LD = ${JAIL} ${ADV_TOOLCHAIN_PATH}/bin/gcc
OBJDUMP = ${JAIL} ${ADV_TOOLCHAIN_PATH}/bin/objdump
#this line is very specifically-written to explicitly-place the ATx.x stuff at the FRONT of the VPATH dirs.
#this is a REQUIREMENT of the advanced toolchain for linux.
VPATH_DIRS:= ${ADV_TOOLCHAIN_PATH}/lib64 ${VPATH_DIRS}
#see the ld flags below (search for rpath). This puts the atx.x stuff on the front
#which is REQUIRED by the toolchain.
RPATH_PREPEND = -rpath,${ADV_TOOLCHAIN_PATH}/lib64
CFLAGS += ${COMMONFLAGS} \
-Wall ${CUSTOMFLAGS} ${ARCHFLAGS} \
-R '$$ADV_TOOLCHAIN_PATH/lib64:$$ORIGIN/../lib:$$ORIGIN:/lib:/usr/lib:/opt/ibm/capikv/lib' \
${INCFLAGS}
LDFLAGS = ${COMMONFLAGS} -Wl,${RPATH_PREPEND},-rpath,$$ORIGIN/../lib,-rpath,$$ORIGIN,-rpath,$(DEFAULT_LIB_INSTALL_PATH)
else
CC_RAW = gcc
CXX_RAW = g++
CC = ${CC_RAW}
CXX = ${CXX_RAW}
LD = gcc
OBJDUMP = objdump
#if we are NOT using the atx.x stuff, prepend nothing.
RPATH_PREPEND =
CFLAGS += ${COMMONFLAGS} \
-Wall ${CUSTOMFLAGS} ${ARCHFLAGS} \
${INCFLAGS}
LDFLAGS = ${COMMONFLAGS}
endif
#TODO: Find correct flags for surelock
#moved custom P8 tunings to customrc file.
COMMONFLAGS = ${EXTRACOMMONFLAGS}
ifndef NO_O3
COMMONFLAGS += -O3
endif
#add support for the rev ID header
GITREVISION:=$(shell git rev-list HEAD 2>/dev/null| wc -l)-$(shell git rev-parse --short HEAD 2>/dev/null)
CUSTOMFLAGS += -DGITREVISION='"${GITREVISION}"'
#if ALLOW_WARNINGS is NOT defined, we assume we are compiling production code
#as such, we adhere to strict compile flags. If this is defined then we warn
#but allow the compile to continue.
ifndef ALLOW_WARNINGS
CFLAGS += -Werror
CXXFLAGS += -Werror
endif
ifdef COVERAGE
COMMONFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -lgcov
LINKLIBS += -lgcov
endif
ASMFLAGS = ${COMMONFLAGS}
CXXFLAGS += ${CFLAGS} -fno-rtti -fno-exceptions -Wall
#RPATH order is important here. the prepend var lets us throw the ATxx stuff in first if needed.
INCDIR = ${ROOTPATH}/src/include/
_INCDIRS = ${INCDIR} ${EXTRAINCDIR}
INCFLAGS = $(addprefix -I, ${_INCDIRS} )
ASMINCFLAGS = $(addprefix $(lastword -Wa,-I), ${_INCDIRS})
OBJECTS = $(addprefix ${OBJDIR}/, ${OBJS})
LIBRARIES = $(addprefix ${IMGDIR}/, ${LIBS})
ifdef IMGS
IMGS_ = $(addprefix ${IMGDIR}/, ${IMGS})
LIDS = $(foreach lid,$(addsuffix _LIDNUMBER, $(IMGS)),$(addprefix ${IMGDIR}/,$(addsuffix .ruhx, $($(lid)))))
IMAGES = $(addsuffix .bin, ${IMGS_}) $(addsuffix .elf, ${IMGS_}) ${LIDS}
#$(addsuffix .ruhx, ${IMGS_})
endif
${OBJDIR}/%.o: %.C
@mkdir -p ${OBJDIR}
${CXX} -c ${CXXFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDIR}/%.list : ${OBJDIR}/%.o
${OBJDUMP} -dCS $@ > $(basename $@).list
${OBJDIR}/%.o: %.c
@mkdir -p ${OBJDIR}
${CC} -c ${CFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDIR}/%.o : %.S
@mkdir -p ${OBJDIR}
${CC} -c ${ASMFLAGS} $< -o $@ ${ASMINCFLAGS} ${INCFLAGS} -iquote .
${OBJDIR}/%.dep : %.C
@mkdir -p ${OBJDIR};
@rm -f $@;
${CXX} -M ${CXXFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${OBJDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${OBJDIR}/%.dep : %.c
@mkdir -p ${OBJDIR};
@rm -f $@;
${CC} -M ${CFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${OBJDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${OBJDIR}/%.dep : %.S
@mkdir -p ${OBJDIR};
@rm -f $@;
${CC} -M ${ASMFLAGS} $< -o $@.$$$$ ${ASMINCFLAGS} ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${OBJDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${IMGDIR}/%.so : ${OBJECTS}
@mkdir -p ${IMGDIR}
${LD} -shared -z now ${LDFLAGS} -o $@ $(OBJECTS) $(MODULE_LINKLIBS) ${LIBPATHS}
# ${LD} -shared -z now ${LDFLAGS} -o $@ $(OBJECTS)
${PGMDIR}/%.o : %.c
@mkdir -p ${PGMDIR}
${CC} -c ${CFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDUMP} -dCS $@ > $(basename $@).list
${PGMDIR}/%.o : %.C
@mkdir -p ${PGMDIR}
${CXX} -c ${CXXFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDUMP} -dCS $@ > $(basename $@).list
${PGMDIR}/%.dep : %.C
@mkdir -p ${PGMDIR};
@rm -f $@;
${CXX} -M ${CXXFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${PGMDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${PGMDIR}/%.dep : %.c
@mkdir -p ${PGMDIR};
@rm -f $@;
${CC} -M ${CFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${PGMDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${TESTDIR}/%.o : %.c
@mkdir -p ${TESTDIR}
${CC} -c ${CFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDUMP} -dCS $@ > $(basename $@).list
${TESTDIR}/%.o : %.C
@mkdir -p ${TESTDIR}
${CXX} -c ${CXXFLAGS} $< -o $@ ${INCFLAGS} -iquote .
${OBJDUMP} -dCS $@ > $(basename $@).list
${TESTDIR}/%.dep : %.C
@mkdir -p ${TESTDIR};
@rm -f $@;
${CXX} -M ${CXXFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${TESTDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${TESTDIR}/%.dep : %.c
@mkdir -p ${TESTDIR};
@rm -f $@;
${CC} -M ${CFLAGS} $< -o $@.$$$$ ${INCFLAGS} -iquote .; \
sed 's,\($*\)\.o[ :]*,${TESTDIR}/\1.o $@ : ,g' < $@.$$$$ > $@;
@rm -f $@.$$$$
${BEAMDIR}/%.beam : %.C
@mkdir -p ${BEAMDIR}
${BEAMCMD} -I ${INCDIR} ${CXXFLAGS} ${BEAMFLAGS} $< \
--beam::complaint_file=$@ --beam::parser_file=/dev/null
${BEAMDIR}/%.beam : %.c
@mkdir -p ${BEAMDIR}
${BEAMCMD} -I ${INCDIR} ${CXXFLAGS} ${BEAMFLAGS} $< \
--beam::complaint_file=$@ --beam::parser_file=/dev/null
${BEAMDIR}/%.beam : %.S
echo Skipping ASM file.
%.dep:
cd ${basename $@} && ${MAKE} dep
%.d:
cd ${basename $@} && ${MAKE} code_pass
%.test:
cd ${basename $@} && ${MAKE} test
%.fvt:
cd ${basename $@} && ${MAKE} fvt
%.unit:
cd ${basename $@} && ${MAKE} unit
%.clean:
cd ${basename $@} && ${MAKE} clean
%.beamdir:
cd ${basename $@} && ${MAKE} beam
#Build a C-file main, build the *_OFILES into OBJDIR, and link them together
define PROGRAMS_template
$(1)_PGM_OFILES = $(addprefix ${PGMDIR}/, $($(notdir $(1)_OFILES))) $(addprefix $(PGMDIR)/, $(notdir $1)).o
$(1): $$($(1)_PGM_OFILES) $(notdir $(1)).c
ALL_OFILES += $$($(1)_PGM_OFILES) $(1)
endef
$(foreach pgm,$(PROGRAMS),$(eval $(call PROGRAMS_template,$(pgm))))
$(PROGRAMS):
@mkdir -p ${PGMDIR}
$(LINK.o) $(CFLAGS) $(LDFLAGS) $($(@)_PGM_OFILES) $(LINKLIBS) ${LIBPATHS} -o $@
#-------------------------------------------------------------------------------
#Build a C-file main, build the *_OFILES into TESTDIR, and link them together
define BIN_TESTS_template
$(1)_BTEST_OFILES = $(addprefix ${TESTDIR}/, $($(notdir $(1)_OFILES))) $(addprefix $(TESTDIR)/, $(notdir $1)).o
$(1): $$($(1)_BTEST_OFILES) $(notdir $(1)).c
ALL_OFILES += $$($(1)_BTEST_OFILES) $(1)
endef
$(foreach bin_test,$(BIN_TESTS),$(eval $(call BIN_TESTS_template,$(bin_test))))
$(BIN_TESTS):
$(LINK.o) $(CFLAGS) $(LDFLAGS) $($(@)_BTEST_OFILES) $(LINKLIBS) ${LIBPATHS} -o $@
#Build a C++ file that uses gtest, build *_OFILES into TESTDIR, link with gtest_main
define GTESTS_template
GTEST_DEPS = $(TESTDIR)/gtest-all.o $(TESTDIR)/gtest_main.o
$(1)_GTESTS_OFILES = $(addprefix $(TESTDIR)/,$($(notdir $(1))_OFILES)) $(addprefix $(TESTDIR)/, $(notdir $1)).o
$(1): $$(GTEST_DEPS) $$($(1)_GTESTS_OFILES) $(notdir $(1)).C
ALL_OFILES += $$($(1)_GTESTS_OFILES) $(1)
endef
$(foreach _gtest,$(GTESTS_DIR),$(eval $(call GTESTS_template,$(_gtest))))
#Find out if a header exists or not by creating a one-liner c program that includes it,
#compiling that, and passing the results back as a 'y' or 'n' - liberated from github.com/ibm-capi/libcxl's Makefile
CHECK_HEADER = $(shell echo \\\#include $(1) | \
$(CC) $(CFLAGS) -E - > /dev/null 2>&1 && echo y || echo n)
#Get cxlflash_ioctl.h if we can't find it on the default include path. Note that if the host system already has one in the system's include libs,
#we won't download a new file. To download a new file, delete the existing one...
${ROOTPATH}/src/include/scsi/cxlflash_ioctl.h:
ifeq ($(call CHECK_HEADER,"<scsi/cxlflash_ioctl.h>"),n)
@echo "WARNING: Downloading new cxlflash_ioctl.h from Jenkins"
mkdir -p ${ROOTPATH}/src/include/scsi
wget -P ${ROOTPATH}/src/include/scsi -q http://hydepark.aus.stglabs.ibm.com:8081/job/ga2-kernel/lastSuccessfulBuild/artifact/linux/include/uapi/scsi/cxlflash_ioctl.h
endif
$(GTESTS_DIR):
$(CXX) $(CFLAGS) $(LDFLAGS) $($(@)_GTESTS_OFILES) $(GTEST_DEPS) $(LINKLIBS) ${LIBPATHS} -o $@
#-------------------------------------------------------------------------------
#Build a C++ file that uses gtest, build *_OFILES into TESTDIR, link with gtest_main
define GTESTS_NM_template
GTEST_NM_DEPS = $(TESTDIR)/gtest-all.o
$(1)_GTESTS_NM_OFILES = $(addprefix $(TESTDIR)/,$($(notdir $(1))_OFILES)) $(addprefix $(TESTDIR)/, $(notdir $1)).o
$(1): $$(GTEST_NM_DEPS) $$($(1)_GTESTS_NM_OFILES) $(notdir $(1)).C
ALL_OFILES += $$($(1)_GTESTS_NM_OFILES) $(1)
endef
$(foreach _gtest_nm,$(GTESTS_NM_DIR),$(eval $(call GTESTS_NM_template,$(_gtest_nm))))
$(GTESTS_NM_DIR):
$(CXX) $(CFLAGS) $(LDFLAGS) $($(@)_GTESTS_NM_OFILES) $(GTEST_NM_DEPS) $(LINKLIBS) ${LIBPATHS} -o $@
#-------------------------------------------------------------------------------
DEPS += $(addsuffix .dep, ${BIN_TESTS}) $(addsuffix .dep, ${PROGRAMS}) \
$(addsuffix .dep, ${GTESTS_DIR}) $(OBJECTS:.o=.dep) \
$(addsuffix .dep, ${GTESTS_NM_DIR})
BEAMOBJS = $(addprefix ${BEAMDIR}/, ${OBJS:.o=.beam})
GENTARGET = $(addprefix %/, $(1))
${PROGRAMS} ${BIN_TESTS} ${GTESTS_DIR} $(GTESTS_NM_DIR) ${OBJECTS} ${LIBRARIES}: makefile
${LIBRARIES}: ${OBJECTS}
${EXTRA_PARTS} ${PROGRAMS}: ${LIBRARIES}
$(GTESTS_DIR) $(GTESTS_NM_DIR) $(BIN_TESTS): $(GTEST_TARGETS)
#cxlflash_ioctl.h dep is necessary to cause the "wget" wagon to go download a header from the CI server... look below for the appropriate rule / recipe
dep: ${SUBDIRS:.d=.dep} ${DEPS} ${ROOTPATH}/src/include/scsi/cxlflash_ioctl.h
code_pass: ${SUBDIRS} ${LIBRARIES} ${EXTRA_PARTS} ${PROGRAMS}
test: ${SUBDIRS:.d=.test} ${BIN_TESTS} ${GTESTS_DIR} ${GTESTS_NM_DIR}
fvt: ${SUBDIRS:.d=.fvt}
unit: ${SUBDIRS:.d=.unit}
beam: ${SUBDIRS:.d=.beamdir} ${BEAMOBJS}
docs: ${ROOTPATH}/src/build/doxygen/doxygen.conf
@rm -rf ${ROOTPATH}/obj/doxygen/*
@cd ${ROOTPATH}; doxygen src/build/doxygen/doxygen.conf
install:
rm -rf ${PKGDIR}/install_root/*
cd ${ROOTPATH}/src/build/install && ${MAKE}
packaging:
${MAKE} install
cd ${ROOTPATH}/src/build/packaging && ${MAKE}
cscope:
@mkdir -p ${ROOTPATH}/obj/cscope
(cd ${ROOTPATH}/obj/cscope ; rm -f cscope.* ; \
find ../../ -name '*.[CHchS]' -type f -fprint cscope.files; \
cscope -bqk)
ctags:
@mkdir -p ${ROOTPATH}/obj/cscope
(cd ${ROOTPATH}/obj/cscope ; rm -f tags ; \
ctags --recurse=yes --fields=+S ../../src)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(MAKECMDGOALS),cleanall)
ifneq ($(MAKECMDGOALS),tests)
ifneq ($(MAKECMDGOALS),unit)
ifneq ($(MAKECMDGOALS),fvt)
ifneq ($(MAKECMDGOALS),run_unit)
ifneq ($(MAKECMDGOALS),run_fvt)
ifneq ($(MAKECMDGOALS),install)
ifneq ($(MAKECMDGOALS),packaging)
-include $(DEPS)
endif
endif
endif
endif
endif
endif
endif
endif
endif
cleanud :
rm -f ${UD_OBJS}
clean: cleanud ${SUBDIRS:.d=.clean}
(rm -f ${OBJECTS} ${OBJECTS:.o=.dep} ${OBJECTS:.o=.list} \
${OBJECTS:.o=.o.hash} ${BEAMOBJS} ${LIBRARIES} \
${IMAGES} ${IMAGES:.bin=.list} ${IMAGES:.bin=.syms} \
${IMAGES:.bin=.bin.modinfo} ${IMAGES:.ruhx=.lid} \
${IMAGES:.ruhx=.lidhdr} ${IMAGES:.bin=_extended.bin} \
${IMAGE_EXTRAS} ${TESTDIR}/* \
${EXTRA_OBJS} ${_GENFILES} ${EXTRA_PARTS} ${EXTRA_CLEAN}\
${PROGRAMS} ${ALL_OFILES} \
*.a *.o *~* )
cleanall:
@if [[ -e ${ROOTPATH}/obj ]]; then rm -Rf ${ROOTPATH}/obj/*; fi
@if [[ -e $(IMGDIR) ]]; then rm -Rf $(IMGDIR)/*; fi
@if [[ -e $(PKGDIR) ]]; then rm -Rf $(PKGDIR)/*; fi
@echo "clean done"
ifdef IMAGES
${MAKE} ${IMAGES} ${IMAGE_EXTRAS}
endif