-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (28 loc) · 845 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
41
CC := gcc
AR := $(CROSS_COMPILE)$(AR)
AS := $(CROSS_COMPILE)$(AS)
CC := $(CROSS_COMPILE)$(CC)
CXX := $(CROSS_COMPILE)$(CXX)
CPP := $(CROSS_COMPILE)$(CPP)
CANONICAL_TARGET ?= riscv64-unknown-linux-gnu-
CFLAGS ?= -Wall -Wextra -g -O0
TARGETS = dump owl mininit dump-bin
all: $(TARGETS)
# Remove when owl.h becomes stable and lives in sysroot/usr/include
dump.o dump-bin.o owl.o: owl.h
dump: dump.o source_hashmap.o
dump.o: syscalltable.h mcalltable.h source_hashmap.h
dump:
$(CC) $^ -o $@ -lstdc++
offs2vaddr: offs2vaddr.o
syscalltable.h: syscalltable-gen.h
GENERATED = syscalltable-gen.h
syscalltable-gen.h: syscalltable-in.h
$(CANONICAL_TARGET)cpp $< -o $@
owl: owl.o
mininit: mininit.c
$(CANONICAL_TARGET)gcc $(CFLAGS) -static $^ -o $@
$(CANONICAL_TARGET)strip -g $@
clean:
rm -f $(TARGETS) $(GENERATED) *.o
.PHONY: clean