-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 725 Bytes
/
Makefile
File metadata and controls
28 lines (22 loc) · 725 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
C_SOURCES = $(wildcard src/*.c)
HEADERS = $(wildcard src/*.h)
OBJ = ${C_SOURCES:.c=.o}
CFLAGS = -Wall -O3 -fcommon
CC=gcc
all: libcbrain.so
%.o: %.c
$(CC) -c $< -o $@ $(CFLAGS) -fPIC
libcbrain.so: ${OBJ}
$(CC) -shared -o $@ -lSDL2 -lpthread $(CFLAGS) $^
strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag $@
clean:
rm -f src/*.o
rm -f examples/libcbrain.so
rm -f examples/tem_test
rm -f examples/cbrain
install: libcbrain.so
install -m 777 $^ ${PREFIX}/lib/
install -m 777 src/cbrain.h ${PREFIX}/include
uninstall:
rm ${PREFIX}/lib/libcbrain.so
rm ${PREFIX}/include/cbrain.h