1234567891011121314151617181920 |
- CC = gcc
- CFLAGS = -Wall -fPIC -O3 --std=c99
- LIBFLAG = -shared
- OBJFLAG = -c
- LIBNAME=libso_stdio.so
- SOURCES := $(shell find ./src -name '*.c')
- build: libso_stdio.so
- .c.o:
- $(CC) $(OBJFLAG) $(CFLAGS) $*.c -o $@
- libso_stdio.so: $(SOURCES:.c=.o)
- $(CC) $(LIBFLAG) $^ -o $(LIBNAME)
- clean:
- find -type f -name "*.o" -delete; rm -f $(LIBNAME)
|