-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (19 loc) · 684 Bytes
/
Makefile
File metadata and controls
28 lines (19 loc) · 684 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
# Copyright (c) 2021-2026 Praveen Vaddadi. MIT License.
CC = gcc
CFLAGS = -O3 -pthread -fPIC
all: libspaces.a libspaces.so
spaces.o: spaces.c
$(CC) $(CFLAGS) -c $< -o $@
libspaces.a: spaces.o
ar rc $@ $< && ranlib $@
libspaces.so: libspaces.a
$(CC) -shared -o $@ -Wl,--whole-archive $< -Wl,--no-whole-archive -lpthread
test: libspaces.a test/test.c
$(CC) $(CFLAGS) test/test.c -Wl,--whole-archive libspaces.a -Wl,--no-whole-archive -lpthread -o test_bin && ./test_bin test/test.input && rm -f test_bin
bench: libspaces.so
@./bench.sh
bench-all: libspaces.so
@./bench.sh -a -T
clean:
rm -f spaces.o libspaces.a libspaces.so
.PHONY: all test bench bench-all clean