-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
156 lines (119 loc) · 4.22 KB
/
Makefile
File metadata and controls
156 lines (119 loc) · 4.22 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.SECONDARY:
#BASIC_CFLAGS=-std=c18 -Wpedantic -Wall -Wextra #-Og -g3 -fsanitize=address,undefined
BASIC_CFLAGS=-std=c18 -Wpedantic -Wall -Wextra -Oz -flto
CFLAGS=$(BASIC_CFLAGS) -Iplutovg/include -Iwork -DPLUTOVG_BUILD $$(pkgconf --cflags SDL2)
LDLIBS=$$(pkgconf --libs SDL2)
OBJECT=work/there_she_is.o
SOURCE=main.c
ARCHIVE=plutovg.a
demo:$(SOURCE) $(OBJECT) $(ARCHIVE)
time $(CC) -DFEAT_PLUTOVG -DMOVIE=there_she_is $(CFLAGS) -o $@ $(SOURCE) $(OBJECT) $(ARCHIVE) $(LDLIBS)
work/there_she_is.o:work/there_she_is.c
time $(CC) -ferror-limit=1 -DFEAT_PLUTOVG $(CFLAGS) -c $< -o $@
there_she_is.js:work/there_she_is.c
$(CC) -DFEAT_JAVASCRIPT -E -P $< > $@
#time $(CC) -ferror-limit=1 -DFEAT_PLUTOVG $(CFLAGS) -c -O0 $<
work/there_she_is.c:main.rs work/there_she_is.swf
#there_she_is.h:main.rs there_she_is.swf
plutovg:
git clone https://github.com/sammycage/plutovg.git
plutovg.a:
pushd plutovg/source && \
$(CC) -DPLUTOVG_BUILD -Wno-sign-compare -Wno-unused-function -c *.c -I../include && \
ar r ../../plutovg.a *.o
#SOKOL=https://raw.githubusercontent.com/floooh/sokol-samples/d91015d455409f20fc1b376fae1b29e0cce1e9ef
#shell.html:
# curl $(SOKOL)/webpage/shell.html > $@
clean:
rm -f plutovg.a there_she_is.o demo.exe demo swf2c swf2c.exe \
work/*.js work/*.gz work/*.c work/*.h work/*.br work/*.zst work/*.o work/*.js work/*.html work/*.wasm
TABLES=movies_efficiency.txt movies_geral.txt cronograma.txt \
bibs_leitura.txt bibs_vector.txt bibs_janelas.txt
#TCC_DRAFT=-d IsDraft=""
tcc.pdf:tcc.mom om.tmac abnt.tmac $(TABLES)
soelim $< | pdfmom -Kutf8 $(TCC_DRAFT) -M. -pt -mabnt > $@
# groff -Kutf8 -t -Tpdf om.tmac $< > $@
abnt.pdf:abnt.mom abnt.tmac bib.txt
soelim $< | pdfmom -Kutf8 -M. -mabnt > $@
MOM_PATH=/usr/share/groff/1.23.0/tmac/om.tmac
tcc.patch:
-diff -u om.tmac.orig om.tmac > $@
om.tmac:
cp om.tmac.orig $@ && patch < tcc.patch
see:abnt.pdf tcc.pdf
-mv tcc.pdf ../storage/downloads/tcc.pdf
-mv abnt.pdf ../storage/downloads/abnt.pdf
include movies.d
fake:
touch $(MOVIES_GENERATED_C)
sleep 1
touch $(MOVIES_JAVASCRIPT)
sleep 1
touch $(MOVIES_COMPRESSED)
movies.a:$(GENERATED_C_TU)
ar r $@ $(GENERATED_C_TU)
raw:raw.c movies.a $(ARCHIVE)
$(CC) -DFEAT_PLUTOVG $(BASIC_CFLAGS) -Iplutovg/include -Iwork -DPLUTOVG_BUILD -o $@ raw.c movies.a $(ARCHIVE)
movies.d:movies.m4
m4 -Dgen=m $< > $@
movies.c:movies.m4
m4 -Dgen=c $< | nroff -t > $@
movies.h:movies.m4
m4 -Dgen=h $< > $@
movies_geral.txt:movies.m4 $(MOVIES_360P) hack.awk
m4 -Dgen=geral $< > $@
movies_stats_1.txt:movies.m4
m4 -Dgen=stats_1 $< > $@
movies_quality.txt:movies.m4
m4 -Dgen=quality $< > $@
movies_efficiency.txt:movies.m4 $(MOVIES_COMPRESSED) hack.pl
m4 -Dgen=efficiency $< > $@
swf2c:main.rs
cargo b -r
cp target/release/swf2c ./
-cp target/debug/swf2c.pdb ./
swf2pdf:swf2pdf.c
$(CC) $(BASIC_CFLAGS) $$(pkgconf --cflags --libs cairo-pdf) -DFEAT_WINDOWS -o $@ $<
#work/there_she_is.dll:work/there_she_is.c
#work/miss_dynamite_xiv.dll:work/miss_dynamite_xiv.c
# $(CC) $(DLL_FLAGS) -o $@ -shared $<
image.pdf:swf2pdf work/there_she_is.dll
./swf2pdf work/there_she_is.dll 2150 $@
image2.pdf:swf2pdf work/miss_dynamite_xiv.dll
./swf2pdf work/miss_dynamite_xiv.dll 4525 $@
include pictures.d
slides.pdf:slides.mom $(TABLES) bib.txt pictures.txt $(PICTURES)
soelim $< | pdfmom -Kutf8 -M. -t -mabnt > $@
pictures.d:pictures.m4
m4 -Dgen=AS_MAKE_LIST $< > $@ && m4 -Dgen=AS_MAKE_RECIPE $< >> $@
pictures.txt:pictures.m4 swf2c $(PICTURES) hack.sh
m4 -Dgen=AS_MOM $< > $@
tcc2.pdf:tcc2.mom om.tmac abnt.tmac bib2.txt pictures.txt
soelim $< | pdfmom -Kutf8 -M. -pt -mabnt > $@
proxy:proxy.c
$(CC) -std=c11 -O3 -o $@ $<
.SUFFIXES: .swf .c .h .o .zip .html .js .dll
.swf.c:
./swf2c -c $< > $@
./swf2c -h $< > $*.h
#.swf.h:
EMSCRIPTEN_FLAGS=-Oz -flto
.c.js:
NODE_OPTIONS=--max-old-space-size-percentage=90 emcc \
-ferror-limit=1 -std=c18 -mreference-types \
-Iwork \
-DFEAT_HTML5 -DMOVIE=$(*F) \
$(EMSCRIPTEN_FLAGS) \
main.c $< \
-sALLOW_MEMORY_GROWTH \
--use-port=sdl2 \
-o $*.html \
--shell-file=shell.html
.js.zip:
7z a $@ $*.{html,js,wasm}
7z rn $@ $*.html index.html
DLL_FLAGS=-std=c99 -ferror-limit=1 \
-Wpedantic -Wall -Wextra -Wno-unused-function \
$$(pkgconf --cflags --libs cairo) -DFEAT_CAIRO
.c.dll:
$(CC) $(DLL_FLAGS) -o $@ -shared $<