Added README.
[agg.git] / Makefile
blob6336041602efa5437c97431d63dc06146cb0954d
1 -include Make.config
3 PREFIX ?= /usr/local
4 MANDIR ?= $(PREFIX)/man
6 INST ?= install
7 RM ?= rm
8 CC ?= gcc
10 CFLAGS=-W -Wall -Werror -Wfatal-errors -Wextra -pedantic-errors -std=c89
11 LDFLAGS=-lexpat
12 LIBS=expat.o fail.o rss.o stack.o text.o layer.o fs.o
13 POBJ=agg.o
14 POUT=agg
15 TOBJ=tests_dev.o
16 TOUT=tests_dev
17 TUSR=tests_usr.sh
18 MAN=agg.1
20 all: $(POUT)
21 tests: run_tests_dev run_tests_usr
23 install: all
24 $(INST) -m 555 -s $(POUT) $(PREFIX)/bin
25 $(INST) -m 444 $(MAN) $(MANDIR)/man1
27 uninstall:
28 $(RM) $(PREFIX)/bin/$(POUT)
29 $(RM) $(MANDIR)/man1/$(MAN)
31 run_tests_dev: $(TOUT)
32 ./$(TOUT)
34 run_tests_usr: $(POUT)
35 ./$(TUSR)
37 $(POUT): $(LIBS) $(POBJ)
38 $(CC) $(LDFLAGS) $(LIBS) $(POBJ) -o $(POUT)
40 $(TOUT): $(LIBS) $(TOBJ)
41 $(CC) $(LDFLAGS) $(LIBS) $(TOBJ) -o $(TOUT)
43 clean:
44 $(RM) -f $(LIBS) $(POBJ) $(POUT) $(TOBJ) $(TOUT)
46 %.o: %.c
47 $(CC) $(CFLAGS) -c $<