Makefile (757B)
1 # See LICENSE file for copyright and license details. 2 3 include config.mk 4 5 SRC = thread.c 6 OBJ = $(SRC:.c=.o) 7 8 LIB = libthread.a 9 INC = thread.h 10 11 all: $(LIB) threadtest 12 13 $(LIB): $(OBJ) 14 $(AR) -rcs $@ $(OBJ) 15 16 threadtest: threadtest.o $(LIB) 17 $(CC) $(LDFLAGS) -o $@ threadtest.o $(LIB) 18 19 .c.o: 20 $(CC) $(CFLAGS) -c $< 21 22 install: $(LIB) $(INC) $(MAN) 23 @echo @ install libthread to $(DESTDIR)$(PREFIX) 24 @mkdir -p $(DESTDIR)$(PREFIX)/lib 25 @cp $(LIB) $(DESTDIR)$(PREFIX)/lib/$(LIB) 26 @mkdir -p $(DESTDIR)$(PREFIX)/include 27 @cp $(INC) $(DESTDIR)$(PREFIX)/include/$(INC) 28 29 uninstall: 30 @echo @ uninstall libthread from $(DESTDIR)$(PREFIX) 31 @rm -f $(DESTDIR)$(PREFIX)/lib/$(LIB) 32 @rm -f $(DESTDIR)$(PREFIX)/include/$(INC) 33 34 clean: 35 rm -f $(LIB) threadtest threadtest.o $(OBJ)