1ifdef INSTALL_ROOT 2INSTALL_ROOT_CPPFLAGS = -isystem $(INSTALL_ROOT)/include 3INSTALL_ROOT_LDFLAGS = -L$(INSTALL_ROOT)/lib -Wl,-rpath,$(INSTALL_ROOT)/lib 4endif 5 6CFLAGS=-Wall -g 7 8LDLIBS = -lpthread 9 10CHECK_SRC := test-1.c test-2.c test-3.c test-6.c test-7.c test-8.c \ 11 test-9.c test-10.c test-11.c test-12.c test-13.c test-14.c \ 12 test-15.c test-16.c test-17.c test-__pthread_destroy_specific-skip.c 13 14CHECK_OBJS := $(addsuffix .o,$(basename $(notdir $(CHECK_SRC)))) 15CHECK_PROGS := $(basename $(notdir $(CHECK_SRC))) \ 16 $(addsuffix -static, $(basename $(CHECK_SRC))) 17 18%.o: %.c 19 $(CC) $(INSTALL_ROOT_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) $< -c -o $@ 20 21%: %.o 22 $(CC) $(INSTALL_ROOT_LDFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) 23 24%-static: %.o 25 $(CC) -static $(INSTALL_ROOT_LDFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS) 26 27check: $(CHECK_OBJS) $(CHECK_PROGS) 28 for i in $(CHECK_PROGS); do \ 29 echo -n Running $$i...\ ; \ 30 if ./$$i 2>&1 > $$i.out; \ 31 then \ 32 echo Success.; \ 33 else \ 34 echo Failure.; \ 35 fi \ 36 done 37 38clean: 39 rm -f $(CHECK_OBJS) $(CHECK_PROGS) \ 40 $(addsuffix .out,$(basename $(notdir $(CHECK_PROGS))))