The repository formerly known as dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 596B

12345678910111213141516171819202122232425262728293031
  1. BINS = brot gfxx
  2. GFX ?= cocoa
  3. CFLAGS += -Wall -Wextra -Wpedantic
  4. LDLIBS = -lm -lz
  5. LDLIBS_cocoa = -framework Cocoa
  6. LDLIBS_x11 = -lX11
  7. all: .gitignore tags $(BINS)
  8. .gitignore: Makefile
  9. echo '*.o' tags $(BINS) | tr ' ' '\n' > .gitignore
  10. tags: *.h *.c
  11. ctags -w *.h *.c
  12. brot: brot.o $(GFX).o
  13. $(CC) $(LDFLAGS) brot.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
  14. gfxx: gfxx.o $(GFX).o
  15. $(CC) $(LDFLAGS) gfxx.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
  16. clean:
  17. rm -f tags *.o $(BINS)
  18. link:
  19. mkdir -p ~/.local/bin
  20. ln -s -f $(BINS:%=$(PWD)/%) ~/.local/bin
  21. unlink:
  22. rm -f $(BINS:%=~/.local/bin/%)