-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile.MinGW
56 lines (43 loc) · 1.48 KB
/
Makefile.MinGW
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
# Check OS
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifneq (,$(findstring MINGW,$(uname_S)))
X=.exe
endif
ifeq ($(OS),Windows_NT)
X=.exe
endif
# Check CXX flag.
ifeq ($(CXX),clang++)
CXX=clang++
else
CXX=g++
endif
CXXFLAGS = -Wall -g -O2 -std=c++0x
FLTK_CXXFLAGS = $(shell fltk-config --cxxflags)
FLTK_LDFLAGS = $(shell fltk-config --ldstaticflags)
MUPDF_DIR = /d/Programming/mupdf-1.7a-source/build/release
MUPDF_CXXFLAGS = -I/usr/local/include/
MUPDF_LDFLAGS = /usr/local/lib/libmupdf.a $(MUPDF_DIR)/libz.a \
$(MUPDF_DIR)/libmujs.a $(MUPDF_DIR)/libopenjpeg.a \
$(MUPDF_DIR)/libjpeg.a $(MUPDF_DIR)/libfreetype.a \
$(MUPDF_DIR)/libjbig2dec.a
all: pdf2image$(X)
pdf2image$(X): obj obj/main.o obj/window.o obj/pdf.o
@echo "==>Linking pdf2image$(X)..."
$(CXX) -o pdf2image$(X) obj/main.o obj/window.o obj/pdf.o $(FLTK_LDFLAGS) $(MUPDF_LDFLAGS)
obj:
@echo "==>Creating directory for objects..."
mkdir obj
obj/main.o: src/main.cpp src/window.hpp src/pdf.hpp
@echo "==>Compiling main.cpp..."
$(CXX) -c $(CXXFLAGS) $(FLTK_CXXFLAGS) $(MUPDF_CXXFLAGS) -o obj/main.o src/main.cpp
obj/window.o: src/window.cpp src/window.hpp src/pdf.hpp
@echo "==>Compiling window.cpp..."
$(CXX) -c $(CXXFLAGS) $(FLTK_CXXFLAGS) -o obj/window.o src/window.cpp
obj/pdf.o: src/pdf.cpp src/pdf.hpp
@echo "==>Compiling pdf.cpp..."
$(CXX) -c $(CXXFLAGS) $(MUPDF_CXXFLAGS) -o obj/pdf.o src/pdf.cpp
clean:
@echo "==>Cleaning..."
rm -rf obj/*.o
rm -rf pdf2image$(X)