forked from capablevms/cheri-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (28 loc) · 1009 Bytes
/
Makefile
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
40
CC=$(HOME)/cheri/output/sdk/bin/riscv64-unknown-freebsd13-clang
CFLAGS=-march=rv64imafdcxcheri -mabi=l64pc128d --sysroot=$(HOME)/cheri/output/rootfs-riscv64-hybrid -mno-relax -g -O0
ifndef SSHPORT
SSHPORT=10017
endif
export
cfiles := $(wildcard *.c)
examples := $(patsubst %.c,bin/%,$(cfiles))
.PHONY: all run clean
all: $(examples)
lib/%: %.c
$(CC) $(CFLAGS) $< -o $@
bin/timsort: timsort.c lib/timsort_lib.o
$(CC) $(CFLAGS) $< -o $@ lib/timsort_lib.o
bin/timsort_purecap: timsort_purecap.c lib/timsort_lib_purecap.o
$(CC) $(CFLAGS) $< -o $@ lib/timsort_lib_purecap.o
bin/test-timsort: test-timsort.c lib/timsort_lib.o
$(CC) $(CFLAGS) $< -o $@ lib/timsort_lib.o
bin/test-timsort_purecap: test-timsort_purecap.c lib/timsort_lib_purecap.o
$(CC) $(CFLAGS) $< -o $@ lib/timsort_lib_purecap.o
bin/%: %.c
$(CC) $(CFLAGS) $< -o $@
run-%: bin/%
scp -P $(SSHPORT) bin/$(<F) $(<F).c [email protected]:/root
ssh -p $(SSHPORT) [email protected] -t '/root/$(<F)'
clean:
rm -rv bin/*
rm -rv lib/*.o