From eff15be7c050cd7c614b52b997161558bfbc7ab9 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 11 May 2014 15:20:51 +0800 Subject: [PATCH] Makefile - Fix mtest target (and clean up utest targets) --- .travis.yml | 4 +++- Makefile | 27 +++++++++++++++--------- Usermode/Libraries/Makefile.tpl | 4 +++- Usermode/Libraries/acess.ld_src/Makefile | 4 ++-- Usermode/Libraries/crt0.o_src/Makefile | 4 ++-- 5 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index a98da7d9..52dc0327 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,6 @@ compiler: clang #env: # - ARCH=host HOST_ARCH=x86 USE_ACPICA=0 # - ARCH=host HOST_ARCH=x86_64 CC="$CC -m64" -script: "make -k utest mtest" +script: + - "make utest-build mtest-build" + - "make -k utest-run mtest-run" diff --git a/Makefile b/Makefile index c283ec62..d78686be 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ .PHONY: all clean SyscallList all-user -SUBMAKE = $(MAKE) --no-print-directory +SUBMAKE = $(MAKE) +# --no-print-directory USRLIBS := crt0.o acess.ld ld-acess.so libc.so libc++.so libposix.so USRLIBS += libreadline.so libnet.so liburi.so libpsocket.so @@ -66,20 +67,26 @@ all-install: install-Filesystem SyscallList ai-user ai-kmode clean: clean-kmode clean-user install: install-Filesystem SyscallList install-user install-kmode -utest: $(USRLIBS:%=utest-%) +utest-build: $(USRLIBS:%=utest-build-%) +utest-run: $(USRLIBS:%=utest-run-%) +utest: utest-build utest-run -$(USRLIBS:%=utest-%): utest-%: +utest-build-%: @CC=$(NCC) $(SUBMAKE) -C Usermode/Libraries/$*_src generate_exp - @CC=$(NCC) $(SUBMAKE) -C Usermode/Libraries/$*_src utest -k + @CC=$(NCC) $(SUBMAKE) -C Usermode/Libraries/$*_src utest-build +utest-run-%: + @CC=$(NCC) $(SUBMAKE) -C Usermode/Libraries/$*_src utest-run -k # TODO: Module tests using DiskTool and NetTest -mtest: mtest-Network +mtest: mtest-build mtest-run @echo > /dev/null - -mtest-Network: - @$(SUBMAKE) -C Tools/nativelib - @$(SUBMAKE) -C Tools/NetTest - @$(SUBMAKE) -C Tools/NetTest_Runner +mtest-build: + # Network + @CC=$(NCC) $(SUBMAKE) -C Tools/nativelib + @CC=$(NCC) $(SUBMAKE) -C Tools/NetTest + @CC=$(NCC) $(SUBMAKE) -C Tools/NetTest_Runner +mtest-run: + @echo "=== Network Module Test ===" @cd Tools && ./nettest_runner SyscallList: include/syscalls.h diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index 5317079e..5c796c3a 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -42,8 +42,9 @@ all: _libs $(_BIN) $(_XBIN) .PHONY: _libs +.PRECIOUS: .no -HEADERS := $(patsubst include_exp/%,../../include/%,$(shell find include_exp/ -name \*.h)) +HEADERS := $(patsubst include_exp/%,../../include/%,$(shell find include_exp/ -name \*.h 2>/dev/null)) _libs: $(HEADERS) ../../include/%: include_exp/% @@ -58,6 +59,7 @@ generate_exp: $(UTESTS:%=EXP_%.txt) @echo > /dev/null utest-build: $(UTESTS:%=TEST_%) + @echo > /dev/null utest-run: $(UTESTS:%=runtest-%) @echo > /dev/null diff --git a/Usermode/Libraries/acess.ld_src/Makefile b/Usermode/Libraries/acess.ld_src/Makefile index 25a5c565..09a7c8f8 100644 --- a/Usermode/Libraries/acess.ld_src/Makefile +++ b/Usermode/Libraries/acess.ld_src/Makefile @@ -8,7 +8,7 @@ BIN = $(OUTPUTDIR)Libs/acess.ld -.PHONY: all clean install utest generate_exp +.PHONY: all clean install utest utest-build utest-run generate_exp all: $(BIN) @@ -18,7 +18,7 @@ clean: install: $(BIN) # How does one unit test a linker script? -utest generate_exp: +utest generate_exp utest-build utest-run: @echo > /dev/null $(BIN): acess_$(ARCHDIR).ld.h diff --git a/Usermode/Libraries/crt0.o_src/Makefile b/Usermode/Libraries/crt0.o_src/Makefile index 7ddc5f41..3c208960 100644 --- a/Usermode/Libraries/crt0.o_src/Makefile +++ b/Usermode/Libraries/crt0.o_src/Makefile @@ -6,7 +6,7 @@ BIN = $(OUTPUTDIR)Libs/crt0.o $(OUTPUTDIR)Libs/crtbegin.o $(OUTPUTDIR)Libs/crtend.o -.PHONY: all clean install utest generate_exp +.PHONY: all clean install utest utest-build generate_exp all: $(BIN) @@ -16,7 +16,7 @@ clean: $(RM) $(BIN) # Disabled unit tests -utest generate_exp: +utest generate_exp utest-build utest-run: @echo > /dev/null $(OUTPUTDIR)Libs/%.o: %.c -- 2.20.1