forked from jbremer/darm
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 705 Bytes
/
Makefile
File metadata and controls
39 lines (27 loc) · 705 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
33
34
35
36
37
38
39
AR = ar
#CC = gcc
CFLAGS = -std=c99 -Wall -O2 -s -Wextra
ifneq ($(OS),Windows_NT)
PIC_FLAGS = -fPIC
endif
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
GENCODESRC = darm-tbl.c armv7-tbl.c thumb-tbl.c
GENCODEOBJ = darm-tbl.o armv7-tbl.o thumb-tbl.o
STUFF = $(GENCODESRC) $(GENCODEOBJ) $(OBJ) \
tests/tests.exe libdarm.a libdarm.so
default: $(STUFF)
$(GENCODESRC): darmgen.py darmtbl.py darmtbl2.py darmgen.py
python darmgen.py
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $^ $(PIC_FLAGS)
%.exe: %.c $(OBJ) $(GENCODEOBJ)
$(CC) $(CFLAGS) -o $@ $^
%.so: $(OBJ) $(GENCODEOBJ)
$(CC) -shared $(CFLAGS) -o $@ $^
%.a: $(OBJ) $(GENCODEOBJ)
$(AR) cr $@ $^
test: $(STUFF)
./tests/tests.exe
clean:
rm -f $(STUFF)