forked from hamon-in/cpslib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux.mk
37 lines (28 loc) · 795 Bytes
/
linux.mk
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
CC = gcc
CFLAGS = -O0 -g -std=gnu11 -fPIC -march=native -Wall -Wextra -Wunused
CFLAGS += -Werror -Wshadow
CFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS = -shared --coverage
RM = rm -f
TARGET_LIB = libpslib.so
EXEC = driver
SRCS = common.c pslib_linux.c
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: $(EXEC)
.PHONY: shared
shared: $(TARGET_LIB)
$(TARGET_LIB): $(OBJS)
$(CC) ${LDFLAGS} -o $@ $^
$(EXEC): $(EXEC).c $(TARGET_LIB)
$(CC) ${CFLAGS} -o $@ $< -L. -lpslib -Wl,-rpath .
test: clean shared
cd bindings/python && make clean && make && cd - && export LD_LIBRARY_PATH=`pwd` && py.test -v -ra
.PHONY: covclean
covclean:
${RM} *.gcno *.gcda *.gcov *.gch
.PHONY: clean
clean: covclean
${RM} ${TARGET_LIB} ${OBJS} $(EXEC) driver.o
check-syntax:
gcc -Wall -o /dev/null -S ${CHK_SOURCES}