Changeset 01579ad in mainline for uspace/Makefile.common
- Timestamp:
- 2014-04-11T08:10:18Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2bff9860
- Parents:
- 9a5abb78
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
r9a5abb78 r01579ad 78 78 JOB = $(BINARY).job 79 79 OUTPUT = $(BINARY) 80 TEST_BINARY = test-$(BINARY) 80 81 EXTRA_OUTPUT += $(BINARY).disasm 81 82 EXTRA_CLEAN += $(BINARY).map … … 85 86 JOB = $(LIBRARY).job 86 87 OUTPUT = $(LIBRARY).a 88 TEST_BINARY = test-$(LIBRARY) 87 89 endif 88 90 … … 200 202 endif 201 203 204 # PCUT-based unit tests 205 ifeq ($(CONFIG_PCUT_TESTS),y) 206 ifneq ($(TEST_SOURCES),) 207 TEST_OUTPUT = $(TEST_BINARY) 208 TEST_CFLAGS = -I$(LIB_PREFIX)/pcut/include -D__helenos__ 209 TEST_OUTPUT_LIBS = $(LIB_PREFIX)/pcut/libpcut.a 210 ifneq ($(LIBRARY),) 211 TEST_OUTPUT_LIBS += $(OUTPUT) 212 endif 213 TEST_OUTPUT_LIBS += $(TEST_LIBS) 214 endif 215 endif 216 202 217 .PHONY: all clean 203 218 204 219 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(LOUTPUT) $(EXTRA_OUTPUT) 205 220 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 221 222 all-test: $(TEST_OUTPUT) 206 223 207 224 clean: … … 294 311 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 295 312 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES))) 313 TEST_OBJECTS := $(addsuffix .test.o,$(basename $(TEST_SOURCES))) 296 314 297 315 ifneq ($(BINARY),) … … 338 356 endif 339 357 358 ifeq ($(CONFIG_PCUT_TESTS),y) 359 ifneq ($(TEST_OUTPUT),) 360 $(TEST_OUTPUT): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) 361 $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS) 362 ifeq ($(CONFIG_STRIP_BINARIES),y) 363 $(STRIP) $(TEST_OUTPUT) 364 endif 365 endif 366 endif 367 340 368 %.o: %.S $(DEPEND) 341 369 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@ … … 356 384 endif 357 385 386 %.test.o: %.c $(DEPEND) 387 $(CC) $(DEFS) $(CFLAGS) $(TEST_CFLAGS) -c $< -o $@ 388 ifeq ($(PRECHECK),y) 389 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 390 endif 391 358 392 %.lo: %.S $(DEPEND) 359 393 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@ … … 375 409 376 410 $(DEPEND): $(PRE_DEPEND) 377 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null411 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) $(TEST_SOURCES) > $@ 2> /dev/null 378 412 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@ 379 413
Note:
See TracChangeset
for help on using the changeset viewer.