Makefile 594 B

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