Link standalone programs at 0x80010000.
[riscv-isa-sim.git] / Makefile.in
index 240b46c951d959026d02de65a4db80e01f6ebd13..2eb7bfd0443827ed903b902aa7c1034b66652109 100644 (file)
@@ -84,9 +84,9 @@ VPATH := $(addprefix $(src_dir)/, $(sprojs_enabled))
 
 CC            := @CC@
 CXX           := @CXX@
-CFLAGS        += @CFLAGS@ -DPREFIX=\"$(prefix)\"
+CFLAGS        += @CFLAGS@ -DPREFIX=\"$(prefix)\" -Werror
 CPPFLAGS      += @CPPFLAGS@
-CXXFLAGS      += @CXXFLAGS@ -DPREFIX=\"$(prefix)\"
+CXXFLAGS      += @CXXFLAGS@ -DPREFIX=\"$(prefix)\" -Werror
 COMPILE       := $(CXX) -fPIC -MMD -MP $(CPPFLAGS) $(CXXFLAGS) \
                  $(sprojs_include)
 COMPILE_C     := $(CC) -fPIC -MMD -MP $(CPPFLAGS) $(CFLAGS) \
@@ -120,6 +120,10 @@ INSTALL_LIB   := $(INSTALL) -m 644
 INSTALL_EXE   := $(INSTALL) -m 555
 STOW          := @stow@
 
+# Tests
+bintests = tests/gdbserver.py \
+          tests/ebreak.py
+
 #-------------------------------------------------------------------------
 # Include subproject makefile fragments
 #-------------------------------------------------------------------------
@@ -329,8 +333,18 @@ deps : $(deps)
 # Check
 #-------------------------------------------------------------------------
 
-check : $(test_outs)
-       echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segementation' $^; echo
+bintest_outs = $(bintests:=.out)
+junk += $(bintest_outs)
+%.out: % all
+       ./$* < /dev/null 2>&1 | tee $@
+
+check-cpp : $(test_outs)
+       echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segmentation' $^ < /dev/null; echo
+
+check-bin : $(bintest_outs)
+       tail -n 1 $^ < /dev/null
+
+check : check-cpp check-bin
 
 .PHONY : check