-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1.08 KB
/
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
42
43
44
45
46
47
48
49
50
51
CC=gcc
EMCC=emcc
CHECKLIBS = -lcheck -lrt -lpthread -lm
OPTFLAGS = -O3 -g
EMFLAGS = -O3
CFLAGS += $(OPTFLAGS) \
-W \
-Wall \
-Wextra \
-Wimplicit-function-declaration \
-Wredundant-decls \
-Wstrict-prototypes \
-Wundef \
-Wshadow \
-Wpointer-arith \
-Wformat \
-Wreturn-type \
-Wsign-compare \
-Wmultichar \
-Wformat-nonliteral \
-Winit-self \
-Wuninitialized \
-Wformat-security \
-DQR_MAX_VERSION=0
all: test tests
%.bc: %.c
$(EMCC) $(EMFLAGS) -o $@ -c $<
%.o: %.c
$(CC) -o $@ -c $<
test: qr_encode.o test.o
$(CC) $(CFLAGS) qr_encode.o test.o -o test
test_arg.js: qr_encode.bc test_arg.bc
$(EMCC) $(EMFLAGS) qr_encode.bc test_arg.bc -o test_arg.js
qr.js: qr.js.head qr.js.foot test_arg.js
cat qr.js.head test_arg.js qr.js.foot > qr.js
tests: qr_encode.o tests.o
$(CC) $(CFLAGS) qr_encode.o tests.o $(CHECKLIBS) -o tests
clean:
rm -f *.o *.js *.bc *.js.mem test tests