-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (29 loc) · 782 Bytes
/
makefile
File metadata and controls
39 lines (29 loc) · 782 Bytes
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
CFLAGS=-Wall -02 -g -Wextra -Isrc -rdynamic - DNDEBUG $(OPTFLAGS)
SOURCES=$(wildcard src/**/*.c src/*.c)
OBJECTS=$(patsubst %.c,%.o,$(TEST_SRC))
TARGET=build/lib_alg_lin.a
SO_TARGET=$(patsubst %.a,%.so,$(TARGET))
## The target Build
all: $(TARGET) $(SO_TARGET)
dev: CFLAGS=-g -Wall -Isrc -Wextra $(OPTFLAGS)
dev: all
$(TARGET): CFLAGS += -fPIC
$(TARGET): build $(OBJECTS)
ar rcs $@ $(OBJECTS)
ranlib $@
$(SO_TARGET): $(TARGET) $(OBJECTS)
$(CC) -shared -o $@ $(OBEJCTS)
build:
@mkdir -p build
@mkdir -p bin
## The Cleaner
clean:
rm -rf build $(OBJECTS) $(TESTS)
find . -name "*.gc*" -exec rm {} \;
rm -rf 'find . -name "*.dSYM" -print'
## The Install
install: all
install -d $(DESTDIR)/$(PREFIX)/lib
install $(TARGET) $(DESTDIR)/$(PREFIX)/lib
## The checker
##