TARGET = syro_volcasample_example
CC = gcc
AR = ar
RM = rm -f
CFLAGS = -O3 -Wall -W -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings \
-Wconversion -Wfloat-equal -Wpointer-arith -fPIC
LDFLAGS =
SYRODIR = ../syro
EXAMPLEDIR = ../example
VERSION = $(shell git describe --always --tags)
MAJOR_VERSION = $(shell git describe --always --tags | \
sed 's/^\([0-9]\).*/\1/')
LIBS_NAME_BASE = libsyro_volcasample
SONAME = $(LIBS_NAME_BASE).so.$(VERSION)
SRCS = $(SYRODIR)/korg_syro_comp.c \
$(SYRODIR)/korg_syro_func.c \
$(SYRODIR)/korg_syro_volcasample.c \
$(EXAMPLEDIR)/korg_syro_volcasample_example.c
OBJS = $(SRCS:.c=.o)
$(TARGET) : $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(TARGET)
%.o : %c
$(CC) -c $(CFLAGS) $< -o $@
libs: $(SYRODIR)/$(LIBS_NAME_BASE).a $(SYRODIR)/$(SONAME)
$(SYRODIR)/$(LIBS_NAME_BASE).a : $(OBJS)
$(AR) -cvq $@ $(OBJS)
$(SYRODIR)/$(SONAME): $(OBJS)
$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $(OBJS)
ln -s $(SYRODIR)/$(SONAME) $(SYRODIR)/$(LIBS_NAME_BASE).so.$(MAJOR_VERSION)
ln -s $(SYRODIR)/$(SONAME) $(SYRODIR)/$(LIBS_NAME_BASE).so
clean:
$(RM) ./$(TARGET)
$(RM) ./$(TARGET).exe
$(RM) $(SYRODIR)/*.o $(EXAMPLEDIR)/*.o
$(RM) $(SYRODIR)/*.a $(SYRODIR)/*.so*
.PHONY : clean