CFLAGS = -I. -L. -std=c99 -pedantic -Wall -Werror -O3 -g CC = gcc LIBNAME = libctemplates.a BIN_POSTFIX = .exe TEST_1_NAME = t/test_1$(BIN_POSTFIX) $(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_1_NAME): t/test_1.c $(LIBNAME) $(CC) $(CFLAGS) -o $(TEST_1_NAME) t/test_1.c -lctemplates test: $(TEST_1_NAME) $(TEST_1_NAME) install: $(LIBNAME) cp $(LIBNAME) /usr/local/lib mkdir -p /usr/local/include/ctemplates cp *.h /usr/local/include/ctemplates/