Makefile 646 B

1234567891011121314151617181920212223242526272829303132
  1. CC=gcc
  2. PREFIX?=/usr/local
  3. CFLAGS?=-g
  4. MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter
  5. # LDFLAGS+=-static
  6. INCLUDE+=-Iinclude
  7. BINDIR?=$(PREFIX)/bin
  8. MANDIR?=$(PREFIX)/share/man
  9. PCDIR?=$(PREFIX)/share/pkgconfig
  10. OUTDIR=.build
  11. OBJECTS=\
  12. $(OUTDIR)/main.o \
  13. $(OUTDIR)/utf8_fgetch.o \
  14. $(OUTDIR)/utf8_size.o \
  15. $(OUTDIR)/utf8_decode.o
  16. $(OUTDIR)/%.o: src/%.c
  17. @mkdir -p $(OUTDIR)
  18. $(CC) -std=c99 -pedantic -c -o $@ $(CFLAGS) $(MAINFLAGS) $(INCLUDE) $<
  19. graded-writer: $(OBJECTS)
  20. $(CC) $(LDFLAGS) -o $@ $^
  21. all: graded-writer
  22. clean:
  23. rm -f graded-writer
  24. install: all
  25. mkdir -p $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(PCDIR)