-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 1.47 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
CC = i686-pc-toaru-gcc
CFLAGS = -std=c99 -U__STRICT_ANSI__ -O3 -m32 -Wa,--32 -L.
CPPFLAGS = -O3 -m32 -Wa,--32
EXTRAFLAGS = -s -I /home/klange/Projects/third-party/mupdf-1.1-source/fitz
EXECUTABLES = $(TARGETDIR)pdfviewer
BEG = ../util/mk-beg
END = ../util/mk-end
INFO = ../util/mk-info
ERRORS = 2>>/tmp/.`whoami`-build-errors || ../util/mk-error
ERRORSS = >>/tmp/.`whoami`-build-errors || ../util/mk-error
BEGRM = ../util/mk-beg-rm
ENDRM = ../util/mk-end-rm
FREETYPE_INC = -I ${TOOLCHAIN}/include/freetype2/
FREETYPE_LIB = -lfreetype
LIBPNG = -lpng15
LIBM = -lm
LIBZ = -lz
ljpeg = -ljpeg
TARGETDIR = ../hdd/bin/
LOCAL_LIBS = -ltoaru-decorations -ltoaru-yutani -ltoaru-shmemfonts -ltoaru-graphics -ltoaru-dlfcn -ltoaru-hashmap -ltoaru-pex -ltoaru-list -ltoaru-kbd
LOCAL_INC = -I ../userspace/
.PHONY: all clean
all: ${EXECUTABLES}
clean:
@-rm -f ${EXECUTABLES}
libmemalign.so: memalign.c
@${CC} -fPIC -shared -Wl,-soname,libmemalign.so -o libmemalign.so memalign.c -lgcc -lc
libtoaru-fitz.so: toaru-fitz.c
@${CC} ${CFLAGS} ${EXTRAFLAGS} ${FREETYPE_INC} ${LOCAL_INC} -fPIC -shared -Wl,-soname,libtoaru-fitz.so -o libtoaru-fitz.so toaru-fitz.c -lfitz -lmemalign -ltoaru-graphics -lgcc -lc
$(TARGETDIR)pdfviewer: $(TARGETDIR)% : %.c | libmemalign.so
@${BEG} "CC" "$@ $< [w/libs]"
@${CC} ${CFLAGS} ${EXTRAFLAGS} ${FREETYPE_INC} ${LOCAL_INC} -o $@ $< ${LOCAL_LIBS} -lfitz ${FREETYPE_LIB} ${LIBPNG} -ljbig2dec -lopenjpeg ${ljpeg} ${LIBZ} ${LIBM} -lmemalign ${ERRORS}
@${END} "CC" "$< [w/libs]"