Makefile 612 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. run: $(BINS)
  27. for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
  28. GCCHEAD=\
  29. -nostdinc \
  30. -nostdlib \
  31. -I ../include \
  32. -I ../target/include \
  33. -I ../openlibm/include \
  34. -I ../openlibm/src \
  35. ../target/debug/libcrt0.a
  36. GCCTAIL=\
  37. ../target/debug/libc.a \
  38. ../openlibm/libopenlibm.a
  39. %: %.c
  40. gcc -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"