Makefile 825 B

1234567891011121314151617181920212223242526
  1. INLINE_TESTS_CPP = $(patsubst %.cpp,%,$(wildcard *.cpp))
  2. INLINE_TESTS = $(patsubst %.c,%,$(wildcard *.c))
  3. rtarget = helloworld fork vfork
  4. targets = $(rtarget) manifest pal pal_sec
  5. clean-extra = clean-exec
  6. level = ../
  7. include ../Makefile
  8. $(INLINE_TESTS): %: %.c $(libs)
  9. @echo [ $@ ]
  10. @$(CC) $(CFLAGS-debug) -nostdlib -nostartfiles -e main $(LDFLAGS-debug) -o $@ $^
  11. $(INLINE_TESTS_CPP): %: %.cpp $(libs)
  12. @echo [ $@ ]
  13. @$(CXX) $(CFLAGS-debug) -nostdlib -nostartfiles -e main $(LDFLAGS-debug) -o $@ $^
  14. test-helloworld = grep -q "Hello world" OUTPUT
  15. test-printf = grep -q "1 printf printf" OUTPUT
  16. test-fork = grep -q "Hello, Dad" OUTPUT && grep -q "Hello, Kid" OUTPUT
  17. test-vfork = grep -q "Hello, Dad" OUTPUT && grep -q "Hello, Kid" OUTPUT
  18. clean-exec:
  19. find -type f -executable -exec rm {} \;
  20. rm -rf manifest pal pal_sec