]> Pileus Git - site/blob - makefile
Add push make rule
[site] / makefile
1 # Settings
2 PATH    := $(PATH):../ct
3 PROG     = pileus.cgi
4 CC       = gcc
5 CT       = ct
6 CFLAGS   = -Wall -Werror -Wno-unused-result -g --std=c99
7 CPPFLAGS = $(shell pkg-config --cflags glib-2.0) -I../markdown
8 LDFLAGS  = $(shell pkg-config --libs   glib-2.0) -L../markdown -lmarkdown
9
10 # Targets
11 default: test
12
13 all: $(PROG)
14
15 test: $(PROG)
16         ./$(PROG)
17
18 clean:
19         rm -f src/*.o src/html.c $(PROG)
20
21 push: $(PROG)
22         SITE="pileus@pileus.org:~/src/site/";              \
23         PAGES="pileus@pileus.org:~/src/pages/";            \
24         rsync -uavz .htaccess .gitignore $$SITE;           \
25         rsync -uavz --delete --exclude '*~' --exclude '.*' \
26                 pileus.cgi src theme $$SITE;               \
27         rsync -uavz --delete --exclude '*~' --exclude '.*' \
28                 pages/ $$PAGES/;
29
30 # Rules
31 $(PROG): src/main.o src/html.o
32         $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
33
34 %.o: %.c makefile src/html.h
35         $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
36
37 src/%.c: theme/%.ct makefile
38         $(CT) -o $@ $<
39
40 .SECONDARY: