Makefile 586 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. printf \
  18. write
  19. all: $(BINS)
  20. clean:
  21. rm -f $(BINS) *.out
  22. run: $(BINS)
  23. for bin in $(BINS); do echo "# $${bin} #"; "./$${bin}" test args; done
  24. GCCHEAD=\
  25. -nostdinc \
  26. -nostdlib \
  27. -I ../include \
  28. -I ../target/include \
  29. -I ../openlibm/include \
  30. -I ../openlibm/src \
  31. ../target/debug/libcrt0.a
  32. GCCTAIL=\
  33. ../target/debug/libc.a \
  34. ../openlibm/libopenlibm.a
  35. %: %.c
  36. gcc -no-pie -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"