-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (29 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CC = gcc
floatFNames = log log2 log10 exp exp2 exp10 sinh cosh sinpi cospi log2_8 log10_8
float34ROFNames = log log2 log10 exp exp10 exp2 sinh cosh sinpi cospi
floatSrcDir = source/float
floatObjDir = obj/float
float34ROSrcDir = source/float34RO
float34ROObjDir = obj/float34RO
libDir = lib
floatSrc = $(patsubst %, $(floatSrcDir)/%.c, $(floatFNames))
floatObj = $(patsubst %, $(floatObjDir)/%.o, $(floatFNames))
float34ROSrc = $(patsubst %, $(float34ROSrcDir)/%.c, $(float34ROFNames))
float34ROObj = $(patsubst %, $(float34ROObjDir)/%.o, $(float34ROFNames))
all: $(libDir)/floatMathLib.a $(libDir)/float34ROMathLib.a
$(floatObjDir)/%.o: $(floatSrcDir)/%.c
@mkdir -p $(floatObjDir)
$(CC) -std=c11 -O3 -c $^ -Iinclude/ -o $@
$(libDir)/floatMathLib.a: $(floatObj)
@mkdir -p $(libDir)
ar rc $@ $^
$(float34ROObjDir)/%.o: $(float34ROSrcDir)/%.c
@mkdir -p $(float34ROObjDir)
$(CC) -std=c11 -O3 -c $^ -Iinclude/ -o $@
$(libDir)/float34ROMathLib.a: $(float34ROObj)
@mkdir -p $(libDir)
ar rc $@ $^
floatmlib: $(libDir)/floatMathLib.a
float34ROmlib: $(libDir)/float34ROMathLib.a
clean:
rm -rf obj lib *.dSYM