-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (41 loc) · 1.83 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
PREFIX=$(shell echo `pwd`)
PREFIX_DEP=$(PREFIX)/build/imgflo-dependencies/install
VERSION=$(shell echo `git describe --tags`)
CFLAGS += -Wall -Wextra
CFLAGS += -Ofast -g -rdynamic
CFLAGS += -fPIC
CFLAGS += -fomit-frame-pointer
CFLAGS += -funroll-loops -fforce-addr -ftracer -fpeel-loops -fmerge-all-constants
CFLAGS += -Wno-unused-parameter -Wno-sign-compare
CFLAGS += -I. -D_XOPEN_SOURCE=500
CFLAGS += -std=c99
LIBS=gegl-0.3 libsoup-2.4
SYSTEM_LIBS=gio-unix-2.0 json-glib-1.0 libpng OpenEXR
DEPS=$(shell $(PREFIX)/env.sh pkg-config --define-variable=prefix=$(PREFIX_DEP) --libs --cflags $(LIBS))
DEPS+=$(shell $(PREFIX)/env.sh pkg-config --libs --cflags $(SYSTEM_LIBS))
TRAVIS_DEPENDENCIES=$(shell echo `cat .vendor_urls | sed -e "s/heroku/travis-linux/" | tr -d '\n'`)
TARGET=$(shell uname -n)
VIDEO_URL="ftp://vps.jonnor.com/imgflo/printed-electret-microphone.mp4"
all: release
iconographer: env iconographer.c Makefile *.c
$(PREFIX)/env.sh gcc -o ./build/bin/iconographer *.c -I. $(CFLAGS) $(DEPS)
install: travis-deps iconographer
env:
mkdir -p $(PREFIX)/build|| true
mkdir -p $(PREFIX)/build/bin || true
sed -e 's|dir|$(PREFIX_DEP)|' env.sh.in > $(PREFIX)/env.sh
chmod +x $(PREFIX)/env.sh
travis-deps:
wget -O $(PREFIX)/imgflo-dependencies.tgz $(TRAVIS_DEPENDENCIES)
mkdir -p $(PREFIX)/build/imgflo-dependencies
tar -xzf $(PREFIX)/imgflo-dependencies.tgz -C $(PREFIX)/build/imgflo-dependencies
clean:
rm -rf $(PREFIX)/env.sh $(PREFIX)/imgflo-dependencies.tgz $(PREFIX)/frame.png $(PREFIX)/video.mp4
check:
wget -O $(PREFIX)/video.mp4 $(VIDEO_URL)
$(PREFIX)/env.sh $(PREFIX)/build/bin/iconographer -p $(PREFIX)/video.mp4 $(PREFIX)/frame.png
release: install check clean
cd $(PREFIX)/build && tar -czf $(PREFIX)/iconographer-$(VERSION)-$(TARGET).tgz bin
upload:
cd $(PREFIX) && bash $(PREFIX)/upload-to-s3.sh
release-and-upload: release upload