CC = gcc # C compiler CFLAGS = -fPIC -Wall -Wextra -O2 -g # C flags #CFLAGS += -D_WIN32 LDFLAGS = -shared # linking flags RM = rm -f # rm command TARGET_LIB = libsvoxpico.so # target lib #SRCS = main.c src1.c src2.c # source files SRCS := picoacph.c \ picoapi.c \ picobase.c \ picocep.c \ picoctrl.c \ picodata.c \ picodbg.c \ picoextapi.c \ picofftsg.c \ picokdbg.c \ picokdt.c \ picokfst.c \ picoklex.c \ picoknow.c \ picokpdf.c \ picokpr.c \ picoktab.c \ picoos.c \ picopal.c \ picopam.c \ picopr.c \ picorsrc.c \ picosa.c \ picosig.c \ picosig2.c \ picospho.c \ picotok.c \ picotrns.c \ picowa.c OBJS = $(SRCS:.c=.o) .PHONY: all all: ${TARGET_LIB} $(TARGET_LIB): $(OBJS) $(CC) ${LDFLAGS} -o $@ $^ $(SRCS:.c=.d):%.d:%.c $(CC) $(CFLAGS) -MM $< >$@ include $(SRCS:.c=.d) .PHONY: clean clean: -${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d) install: @echo "Copying the library to /usr/lib/" @cp libsvoxpico.so /usr/lib/