Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #
  2. # Copyright (C) 2022 Leah Rowe
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. # config:
  18. # ----------
  19. CC=cc
  20. FORCEC99=-std=c99
  21. CFLAGS=-I. -Wall -Wextra -g $(FORCEC99)
  22. NOLINKER=-c
  23. # commands:
  24. # ----------
  25. all: clean head cat ls date yes
  26. head: head.o
  27. $(CC) $(CFLAGS) head.o -o head
  28. cat: cat.o
  29. $(CC) $(CFLAGS) cat.o -o cat
  30. ls: ls.o
  31. $(CC) $(CFLAGS) ls.o -o ls
  32. date: date.o
  33. $(CC) $(CFLAGS) date.o -o date
  34. yes: yes.o
  35. $(CC) $(CFLAGS) yes.o -o yes
  36. clean:
  37. rm -f head cat ls clean yes *.o
  38. # utils:
  39. # ----------
  40. head.o:
  41. $(CC) $(CFLAGS) $(NOLINKER) head.c -o head.o
  42. cat.o:
  43. $(CC) $(CFLAGS) $(NOLINKER) cat.c -o cat.o
  44. ls.o:
  45. $(CC) $(CFLAGS) $(NOLINKER) ls.c -o ls.o
  46. date.o:
  47. $(CC) $(CFLAGS) $(NOLINKER) date.c -o date.o
  48. yes.o:
  49. $(CC) $(CFLAGS) $(NOLINKER) yes.c -o yes.o