forked from phanikishoreg/sod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (60 loc) · 2 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
BASE_DIR=../
include Makefile.wasm.inc
# SOD does not generally require a Makefile to build. Just drop sod.c and its accompanying
# header files on your source tree and you are done.
NCC = clang
NCFLAGS = -I. -DCPU_FREQ=3600 -O3 -lm -DSOD_DISABLE_CNN -DLIBCOX_DISABLE_DISK_IO
WCFLAGS = -DWASM -I. -DSOD_DISABLE_CNN -lm -DLIBCOX_DISABLE_DISK_IO
#sod: sod.c
# $(CC) sod.c samples/cnn_face_detection.c -o sod_face_detect -I. $(CFLAGS)
EXT = out
WEXT = wout
SAMPLES = resize_image \
license_plate_detection
#SAMPLES = batch_img_loading \
# blob_detection \
# canny_edge_detection \
# cnn_coco \
# cnn_face_detection \
# cnn_object_detection \
# cnn_voc \
# crop_image \
# dilate_image \
# erode_image \
# grayscale_image \
# hilditch_thin \
# hough_lines_detection \
# license_plate_detection \
# minutiae \
# otsu_image \
# realnet_face_detection \
# realnet_face_detection_embedded \
# realnet_train_model \
# resize_image \
# rnn_text_gen \
# rotate_image \
# sobel_operator_img
SAMPLESOUT = $(SAMPLES:%=%.$(EXT))
SAMPLESWOUT = $(SAMPLES:%=%.$(WEXT))
all: clean dir copy
native: samples
wasm: samples.wasm
# samples.wasm
# samples
dir:
mkdir -p bin/
copy:
cp samples/*.png bin/
cp samples/*.jpg bin/
samples: $(SAMPLESOUT)
samples.wasm: $(SAMPLESWOUT)
%.$(EXT):
$(NCC) $(NCFLAGS) sod.c samples/$(@:%.$(EXT)=%.c) -o bin/$@
%.$(WEXT):
$(WASMCC) $(WCFLAGS) $(WASMCFLAGS) $(OPTFLAGS) sod.c samples/$(@:%.$(WEXT)=%.c) $(DUMMY) -o bin/$(@:%.$(WEXT)=%.wasm)
# $(SFCC) bin/$(@:%.$(WEXT)=%.wasm) -o bin/$(@:%.$(WEXT)=%.bc)
# $(CC) ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -D$(USE_MEM) bin/$(@:%.$(WEXT)=%.bc) $(RT_LIBC) $(RT_RT) ${MEMC} -o bin/$@
$(SFCC) --inline-constant-globals --runtime-globals bin/$(@:%.$(WEXT)=%.wasm) -o bin/$(@:%.$(WEXT)=%.bc)
$(CC) --shared -fPIC ${CFLAGS} ${EXTRA_CFLAGS} $(OPTFLAGS) -D$(USE_MEM) -I${ART_INC} bin/$(@:%.$(WEXT)=%.bc) $(WASMISA) ${AMEMC} -o bin/$(@:%.$(WEXT)=%.awsm)
clean:
rm -f bin/*