1BASEDIR = ../../.. 2TARGET = zscilib 3CC = gcc 4CFLAGS = -Wall -Wconversion -Wno-sign-conversion -I. -I$(BASEDIR)/include 5ODIR = obj 6BINDIR = bin 7LIBS = -lm 8 9# Optionally enable ARM THUMB-2 ASM optimised functions 10# CFLAGS += -DCONFIG_ZSL_PLATFORM_OPT=2 11 12# Optionally force single-precision floats (default is double) 13# CFLAGS += -DCONFIG_ZSL_SINGLE_PRECISION=y 14 15_OBJ = main.o matrices.o vectors.o zsl.o 16OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) 17 18$(ODIR)/%.o: %.c 19 @mkdir -p $(ODIR) 20 @echo Compiling $@ 21 @$(CC) -c -o $@ $< $(CFLAGS) 22 23all: $(TARGET) 24 25$(ODIR)/matrices.o: $(BASEDIR)/src/matrices.c 26 @mkdir -p $(ODIR) 27 @echo Compiling $(ODIR)/matrices.o 28 @$(CC) -c -o $@ $< $(CFLAGS) 29 30$(ODIR)/vectors.o: $(BASEDIR)/src/vectors.c 31 @mkdir -p $(ODIR) 32 @echo Compiling $(ODIR)/vectors.o 33 @$(CC) -c -o $@ $< $(CFLAGS) 34 35$(ODIR)/zsl.o: $(BASEDIR)/src/zsl.c 36 @mkdir -p $(ODIR) 37 @echo Compiling $(ODIR)/zsl.o 38 @$(CC) -c -o $@ $< $(CFLAGS) 39 40$(TARGET): $(OBJ) 41 @mkdir -p $(BINDIR) 42 $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $(BINDIR)/$@ $(CFLAGS) $(LIBS) 43 44.PHONY: clean 45 46clean: 47 -@rm -rf $(ODIR) $(BINDIR) 48