Makefile 846 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. BINS=\
  2. alloc \
  3. atof \
  4. atoi \
  5. brk \
  6. args \
  7. chdir \
  8. create \
  9. ctype \
  10. dup \
  11. error \
  12. fchdir \
  13. fcntl \
  14. fsync \
  15. ftruncate \
  16. getid \
  17. link \
  18. math \
  19. rmdir \
  20. pipe \
  21. printf \
  22. write
  23. all: $(BINS)
  24. clean:
  25. rm -f $(BINS) *.out
  26. expected: $(BINS)
  27. mkdir -p expected
  28. for bin in $(BINS); do "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; done
  29. run: $(BINS)
  30. for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
  31. test: $(BINS)
  32. for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
  33. GCCHEAD=\
  34. -nostdinc \
  35. -nostdlib \
  36. -I ../include \
  37. -I ../target/include \
  38. -I ../openlibm/include \
  39. -I ../openlibm/src \
  40. ../target/debug/libcrt0.a
  41. GCCTAIL=\
  42. ../target/debug/libc.a \
  43. ../openlibm/libopenlibm.a
  44. %: %.c
  45. gcc -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"