Makefile 341 B

1234567891011121314151617181920
  1. CC = gcc
  2. CFLAGS = -Wall -fPIC -O3 --std=c99
  3. LIBFLAG = -shared
  4. OBJFLAG = -c
  5. LIBNAME=libso_stdio.so
  6. SOURCES := $(shell find ./src -name '*.c')
  7. build: libso_stdio.so
  8. .c.o:
  9. $(CC) $(OBJFLAG) $(CFLAGS) $*.c -o $@
  10. libso_stdio.so: $(SOURCES:.c=.o)
  11. $(CC) $(LIBFLAG) $^ -o $(LIBNAME)
  12. clean:
  13. find -type f -name "*.o" -delete; rm -f $(LIBNAME)