Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. CC=gcc
  2. CFLAGS=-std=c99 -D_GNU_SOURCE -Wall -Werror
  3. SOURCES=tokenizer.c parser.c interpreter.c variables.c builtins.c region.c stringport.c linenoise/linenoise.c
  4. OBJECTS=$(SOURCES:.c=.o)
  5. all: s
  6. clean:
  7. rm -f *.o
  8. rm -f t6
  9. rm -f s
  10. rm -f supporting/\<
  11. rm -f supporting/\>
  12. rm -f supporting/\>\>
  13. rm -f supporting/redir-box
  14. rm -f supporting/glob
  15. %.o: %.c
  16. $(CC) -I linenoise -c $(CFLAGS) $< -o $@
  17. #t6: $(OBJECTS) t6.c
  18. # $(CC) -o t6 $(OBJECTS) t6.c
  19. s: linenoise $(OBJECTS) s.c
  20. $(CC) -o s $(OBJECTS) s.c
  21. supporting/redir-box: supporting/redir-box.c
  22. $(CC) -o supporting/redir-box supporting/redir-box.c
  23. supporting/glob: supporting/glob.c
  24. $(CC) -o supporting/glob supporting/glob.c
  25. redir-box: supporting/redir-box supporting/glob
  26. rm -f supporting/\<
  27. rm -f supporting/\>
  28. rm -f supporting/\>\>
  29. cd supporting ; ln -s redir-box \<
  30. cd supporting ; ln -s redir-box \>
  31. cd supporting ; ln -s redir-box \>\>
  32. linenoise:
  33. @echo "This project requires the linenoise library!"
  34. @echo "git clone https://github.com/antirez/linenoise.git"
  35. @exit -1