aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 635ab1db5cffb76f13117d34f5ef20ed19e4e026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CFLAGS = -I. -L. -std=c99 -pedantic -Wall -Werror -O3
CC = gcc
LIBNAME = libctemplates.a

$(LIBNAME): ctemplates.o fbuf.o kmp.o hashmap.o
	ar rc $(LIBNAME) ctemplates.o fbuf.o kmp.o hashmap.o
	ranlib $(LIBNAME)

fbuf.o : fbuf.c fbuf.h
	$(CC) $(CFLAGS) -c -o fbuf.o fbuf.c

kmp.o : kmp.c kmp.h
	$(CC) $(CFLAGS) -c -o kmp.o kmp.c

ctemplates.o: ctemplates.c ctemplates.h
	$(CC) $(CFLAGS) -c -o ctemplates.o ctemplates.c

hashmap.o: hashmap.c hashmap.h
	$(CC) $(CFLAGS) -c -o hashmap.o hashmap.c

clean:
	rm -f *.o *.a template

test:
	cd t; ./test.sh

install: $(LIBNAME)
	cp $(LIBNAME) /usr/local/lib
	mkdir /usr/local/include/ctemplates
	cp *.h /usr/local/include/ctemplates/