Makefile (528B)
1 OBJS := $(patsubst %.c,%.o,$(filter-out test.c,$(wildcard *.c))) 2 SOBJS := $(patsubst %.c,%.so.o,$(filter-out test.c,$(wildcard *.c))) 3 INCLUDES := -I. 4 CFLAGS += $(INCLUDES) 5 VERSION = 0.0.1 6 CFLAGS += -Wall -Werror 7 8 all: $(OBJS) 9 10 test: all 11 $(CC) $(CFLAGS) test.c case.o -o test.out $(LDFLAGS) 12 13 %.o: %.c 14 $(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS) 15 16 clean: 17 rm -vf *.o 18 rm -vf *.out 19 rm -vf *.tar.gz 20 21 archive: 22 git archive --format=tar.gz HEAD -o case-$(VERSION).tar.gz 23 24 %.so.o: %.c 25 $(CC) $(CFLAGS) -c $< -o $@ -fpic 26 27 shared: $(SOBJS)