@@ -220,51 +220,40 @@ BLACKWORDS += shmget
220
220
BLACKWORDS += shmat
221
221
endif
222
222
223
- MAINWORDS += "main("
223
+ MAINWORDS += "main("
224
224
225
- LTP_ORIGS_1 := $(shell find $(TESTDIR ) -name * .c | head -n 500)
226
- LTP_ORIGS_2 := $(shell find $(TESTDIR ) -name * .c | head -n 1000|tail -n +501)
227
- LTP_ORIGS_3 := $(shell find $(TESTDIR ) -name * .c | head -n 1500|tail -n +1001)
228
- LTP_ORIGS_4 := $(shell find $(TESTDIR ) -name * .c | head -n 2000|tail -n +1501)
229
-
230
- $(foreach word, $(BLACKWORDS), $(eval BLACKLIST+=$(shell grep -lr $(word) $(LTP_ORIGS_1))))
231
- $(foreach src, $(BLACKSRCS), $(eval BLACKLIST+=$(filter %$(src),$(LTP_ORIGS_1))))
232
-
233
- $(foreach word, $(BLACKWORDS), $(eval BLACKLIST+=$(shell grep -lr $(word) $(LTP_ORIGS_2))))
234
- $(foreach src, $(BLACKSRCS), $(eval BLACKLIST+=$(filter %$(src),$(LTP_ORIGS_2))))
235
-
236
- $(foreach word, $(BLACKWORDS), $(eval BLACKLIST+=$(shell grep -lr $(word) $(LTP_ORIGS_3))))
237
- $(foreach src, $(BLACKSRCS), $(eval BLACKLIST+=$(filter %$(src),$(LTP_ORIGS_3))))
238
-
239
- $(foreach word, $(BLACKWORDS), $(eval BLACKLIST+=$(shell grep -lr $(word) $(LTP_ORIGS_4))))
240
- $(foreach src, $(BLACKSRCS), $(eval BLACKLIST+=$(filter %$(src),$(LTP_ORIGS_4))))
241
-
242
- LTP_ORIGS_1 := $(filter-out $(BLACKLIST ) , $(LTP_ORIGS_1 ) )
243
- LTP_ORIGS_2 := $(filter-out $(BLACKLIST ) , $(LTP_ORIGS_2 ) )
244
- LTP_ORIGS_3 := $(filter-out $(BLACKLIST ) , $(LTP_ORIGS_3 ) )
245
- LTP_ORIGS_4 := $(filter-out $(BLACKLIST ) , $(LTP_ORIGS_4 ) )
225
+ LTP_ORIGS := $(shell find $(TESTDIR ) -name * .c)
226
+ ifneq ($(LTP_ORIGS ) ,)
227
+ $(call SPLITVARIABLE,ORIGS_SPILT,$(LTP_ORIGS),200)
228
+ $(foreach BATCH, $(ORIGS_SPILT_TOTAL), \
229
+ $(foreach word, $(BLACKWORDS), $(eval BLACKLIST+=$(shell grep -lr $(word) $(ORIGS_SPILT_$(BATCH))))) \
230
+ )
231
+ endif
246
232
247
- $(foreach word, $(MAINWORDS), $(eval LTP_MAINCSRCS_1+=$(shell grep -lr $(word) $(LTP_ORIGS_1))))
248
- $(foreach word, $(MAINWORDS), $(eval LTP_MAINCSRCS_2+=$(shell grep -lr $(word) $(LTP_ORIGS_2))))
249
- $(foreach word, $(MAINWORDS), $(eval LTP_MAINCSRCS_3+=$(shell grep -lr $(word) $(LTP_ORIGS_3))))
250
- $(foreach word, $(MAINWORDS), $(eval LTP_MAINCSRCS_4+=$(shell grep -lr $(word) $(LTP_ORIGS_4))))
233
+ $(foreach src, $(BLACKSRCS), $(eval BLACKLIST+=$(filter %$(src),$(LTP_ORIGS))))
251
234
252
- LTP_CSRCS_1 := $(filter-out $(LTP_MAINCSRCS_1 ) , $(LTP_ORIGS_1 ) )
253
- LTP_CSRCS_2 := $(filter-out $(LTP_MAINCSRCS_2 ) , $(LTP_ORIGS_2 ) )
254
- LTP_CSRCS_3 := $(filter-out $(LTP_MAINCSRCS_3 ) , $(LTP_ORIGS_3 ) )
255
- LTP_CSRCS_4 := $(filter-out $(LTP_MAINCSRCS_4 ) , $(LTP_ORIGS_4 ) )
235
+ LTP_ORIGS := $(filter-out $(BLACKLIST ) , $(LTP_ORIGS ) )
236
+ ifneq ($(LTP_ORIGS ) ,)
237
+ $(call SPLITVARIABLE,ORIGS_SPILT,$(LTP_ORIGS),200)
238
+ $(foreach BATCH, $(ORIGS_SPILT_TOTAL), \
239
+ $(foreach word, $(MAINWORDS), $(eval LTP_MAINCSRCS+=$(shell grep -lr $(word) $(ORIGS_SPILT_$(BATCH))))) \
240
+ )
241
+ endif
256
242
243
+ LTP_CSRCS := $(filter-out $(LTP_MAINCSRCS ) , $(LTP_ORIGS ) )
244
+ ifneq ($(LTP_MAINCSRCS ) ,)
245
+ $(call SPLITVARIABLE,MAINCSRC_SPILT,$(LTP_MAINCSRCS),50)
246
+ $(foreach BATCH, $(MAINCSRC_SPILT_TOTAL), \
247
+ $(eval PROGNAME+=$(basename $(shell echo $(MAINCSRC_SPILT_$(BATCH)) | xargs -n 1 | awk -F "[/]" '{print "ltp_"$$(NF-2)"_"$$(NF-1)"_"$$(NF)}' | sed s/-/_/g))) \
248
+ )
249
+ endif
257
250
258
- PROGNAME := $(basename $(shell echo $(LTP_MAINCSRCS_1 ) | xargs -n 1 | awk -F "[/]" '{print "ltp_"$$(NF-2 ) "_"$$(NF-1 ) "_"$$(NF ) }' | sed s/-/_/g) )
259
- PROGNAME += $(basename $(shell echo $(LTP_MAINCSRCS_2 ) | xargs -n 1 | awk -F "[/]" '{print "ltp_"$$(NF-2 ) "_"$$(NF-1 ) "_"$$(NF ) }' | sed s/-/_/g) )
260
- PROGNAME += $(basename $(shell echo $(LTP_MAINCSRCS_3 ) | xargs -n 1 | awk -F "[/]" '{print "ltp_"$$(NF-2 ) "_"$$(NF-1 ) "_"$$(NF ) }' | sed s/-/_/g) )
261
- PROGNAME += $(basename $(shell echo $(LTP_MAINCSRCS_4 ) | xargs -n 1 | awk -F "[/]" '{print "ltp_"$$(NF-2 ) "_"$$(NF-1 ) "_"$$(NF ) }' | sed s/-/_/g) )
262
- MAINSRC = $(LTP_MAINCSRCS_1 ) $(LTP_MAINCSRCS_2 ) $(LTP_MAINCSRCS_3 ) $(LTP_MAINCSRCS_4 )
251
+ MAINSRC = $(LTP_MAINCSRCS )
263
252
PRIORITY = SCHED_PRIORITY_DEFAULT
264
253
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE )
265
254
MODULE = $(CONFIG_TESTING_LTP )
266
255
267
- CSRCS := $(LTP_CSRCS_1 ) $( LTP_CSRCS_2 ) $( LTP_CSRCS_3 ) $( LTP_CSRCS_4 )
256
+ CSRCS := $(LTP_CSRCS )
268
257
CFLAGS += -I$(CURDIR )
269
258
CFLAGS += -I$(TESTDIR ) /include
270
259
endif
0 commit comments