You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

37 lines
583 B

TARGET_EXE=synth_shed
LIB_STATIC=libsynth_shed.a
LIB_DYN=libsynth_shed.so
CFLAGS+=-std=c99 -g -fPIC
SRCS=$(wildcard *.c)
OBJS=$(SRCS:.c=.o)
$(info -----BUILD INFO----)
$(info SRCS $(SRCS))
$(info OBJS $(OBJS))
.PHONY: all lib_static lib_dyn exe clean
all: lib_static lib_dyn exe
lib_static: $(LIB_STATIC)
lib_dyn: $(LIB_DYN)
exe: $(TARGET_EXE)
$(LIB_STATIC): $(OBJS)
$(AR) -rc $@ $^
$(LIB_DYN): $(OBJS)
$(CC) $(CFLAGS) -shared -o $@ $^
$(TARGET_EXE): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
clean:
rm -f $(TARGET_EXE)
rm -f $(LIB_STATIC)
rm -f $(LIB_DYN)
rm -f $(OBJS)