-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 745 Bytes
/
Makefile
File metadata and controls
32 lines (26 loc) · 745 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
# Compiler and linker settings
CC=gcc
CFLAGS=-c
LDFLAGS=-L. -lrustposix
# Default source files
SRC=lind_platform.c
OBJ=$(SRC:.c=.o)
# Pattern rule for object files
%.o: %.c
@echo "Don't forget export LD_LIBRARY_PATH"
$(CC) $(CFLAGS) $< -o $@
# Dynamic target for compiling programs with a main function
%: %.o $(OBJ)
$(CC) $< $(OBJ) $(LDFLAGS) -o $@
# Build user tests
test:
@echo "Building user tests"
CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./build.sh tests.txt
# Build user performance tests
perf-test:
@echo "Building user performance tests"
CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./build.sh perf_tests.txt
# Clean the build
clean:
find tests/ -type f ! -name "*.*" -delete
rm -f -- **/*.o *.so *~ core