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 884B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. GFX ?= cocoa
  2. PREFIX = ~/.local
  3. BINS = brot gfxx
  4. MAN1 = $(BINS:%=man/%.1)
  5. CFLAGS += -Wall -Wextra -Wpedantic
  6. LDLIBS = -lm
  7. LDLIBS_cocoa = -framework Cocoa
  8. LDLIBS_x11 = -lX11
  9. all: .gitignore tags $(BINS)
  10. tags: *.h *.c
  11. ctags -w *.h *.c
  12. brot.o gfxx.o: gfx.h
  13. cocoa.o fb.o x11.o: gfx.h
  14. gfxx.o: png.h
  15. brot: brot.o $(GFX).o
  16. $(CC) $(LDFLAGS) brot.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
  17. gfxx: gfxx.o $(GFX).o
  18. $(CC) $(LDFLAGS) gfxx.o $(GFX).o $(LDLIBS) $(LDLIBS_$(GFX)) -o $@
  19. clean:
  20. rm -f tags *.o $(BINS)
  21. README: man/gfx.7
  22. mandoc man/gfx.7 | col -b -x > README
  23. .gitignore: Makefile
  24. echo '*.o' tags $(BINS) | tr ' ' '\n' > .gitignore
  25. link:
  26. mkdir -p $(PREFIX)/bin $(PREFIX)/share/man/man1
  27. ln -s -f $(BINS:%=$(PWD)/%) $(PREFIX)/bin
  28. ln -s -f $(MAN1:%=$(PWD)/%) $(PREFIX)/share/man/man1
  29. unlink:
  30. rm -f $(BINS:%=$(PREFIX)/bin/%)
  31. rm -f $(MAN1:%=$(PREFIX)/share/man/man1/%)