Makefile 235 B

12345678910111213
  1. SRC=$(wildcard *.c)
  2. OBJ=$(patsubst %.c,%.o,$(SRC))
  3. all: libpthread.a
  4. libpthread.a: $(OBJ)
  5. $(AR) -rcs $@ $(OBJ)
  6. libpthread.so: $(OBJ)
  7. $(CC) $(CFLAGS) -nostdlib -shared -o $@ $(OBJ)
  8. %.o: %.c
  9. $(CC) $(CFLAGS) -fPIC -I . -c $< -o $@