-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.mingw
115 lines (91 loc) · 3.08 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
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
# Makefile for fl_imgtk for MinGW-W64
# (C)2017-2024 Raphael Kim / [email protected]
#
#########################################################################
# About cross compiler, or other platform :
#
# To enable build for embedded linux, you may encomment next 2 lines.
# Or, may need to change your cross compiler path with environments.
# It is up to developer !
# CCPREPATH = ${ARM_LINUX_GCC_PATH}
# CCPREFIX = arm-linux-
# To enable build for embedded linux, change following line.
# CCPATH = ${CCPREPATH}/${CCPREFIX}
CCPATH =
#########################################################################
# Compiler configure.
GCC = ${CCPATH}gcc
GPP = ${CCPATH}g++
AR = ${CCPATH}ar
RL = ${CCPATH}ranlib
# FLTK place ( you may installed it for MSYS )
FLTKCFG = fltk-config --use-images
FLTKDIR := $(shell ${FLTKCFG} --cxxflags)
FLTKLIBDIR := $(shell ${FLTKCFG} --ldflags)
# Sources and how it built
# Optimization issue: recommend to build with using -ffast-math option.
# Change if your CPU architecture supports more high technologies.
INCDIR = ./inc
SOURCEDIR = ./src
OBJDIR = ./obj/Release
OUTBIN = libfl_imgtk.a
OUTDIR = ./lib
INSTDIR = /usr/local/lib
IINSTDIR = /usr/local/include
DEFINEOPT = -DUSING_INTERPOLATED_ROTATE_FREE
DEFINEOPT += -DFLTK_ABI_VERISON=10304
OPTIMIZEOPT = -ffast-math -O3 -s
CPUARCHOPT =
ifeq (debug,$(firstword $(MAKECMDGOALS)))
DEFINEOPT += -DDEBUG
OPTIMIZEOPT = -g3
OUTBIN = libfl_imgtk_d.a
endif
ifeq (avx,$(firstword $(MAKECMDGOALS)))
CPUARCHOPT += -mavx -fopenmp
DEFINEOPT += -DUSING_OMP
OUTBIN = libfl_imgtk_avxomp.a
endif
ifeq (openmp,$(firstword $(MAKECMDGOALS)))
OPTIMIZEOPT += -fopenmp
DEFINEOPT += -DUSING_OMP
OUTBIN = libfl_imgtk_omp.a
endif
CFLAGS = -I$(INCDIR) -I$(SOURCEDIR) -I$(FLTKDIR) $(DEFINEOPT) $(OPTIMIZEOPT) $(CPUARCHOPT) $(BITSOPT)
.PHONY: prepare avx openmp clean preinstall install uninstall
avx: all
openmp: all
debug: all
all: prepare ${OUTDIR}/${OUTBIN}
cleanall: clean cleanlib
install: preinstall install_lib
prepare:
@mkdir -p ${OBJDIR}
@mkdir -p ${OUTDIR}
preinstall:
@if [ ! -e ${INSTDIR} ];then mkdir -p ${INSTDIR}; fi
@if [ ! -e ${IINSTDIR} ];then mkdir -p ${IINSTDIR}; fi
install_lib: ${OUTDIR}/${OUTBIN}
@cp -rf $< ${INSTDIR}
@cp -rf ${INCDIR}/fl_imgtk.h ${IINSTDIR}
uninstall:
@if [ -e ${INSTDIR}/${OUTBIN} ];then rm -f ${INSTDIR}/${OUTBIN}; fi
@if [ -e ${IINSTDIR}/fl_imgtk.h ];then rm -f ${IINSTDIR}/fl_imgtk.h; fi
${OBJDIR}/fl_imgtk_tonemap.o:
@$(GPP) -c ${SOURCEDIR}/fl_imgtk_tonemap.cpp ${CFLAGS} -o $@
${OBJDIR}/fl_smimg.o:
@$(GPP) -c ${SOURCEDIR}/fl_smimg.cpp ${CFLAGS} -o $@
${OBJDIR}/fl_imgtk_clahe.o:
@$(GPP) -c ${SOURCEDIR}/fl_imgtk_clahe.cpp ${CFLAGS} -o $@
${OBJDIR}/fl_imgtk.o:
@$(GPP) -c ${SOURCEDIR}/fl_imgtk.cpp ${CFLAGS} -o $@
${OUTDIR}/${OUTBIN}: ${OBJDIR}/fl_imgtk_tonemap.o ${OBJDIR}/fl_smimg.o ${OBJDIR}/fl_imgtk_clahe.o ${OBJDIR}/fl_imgtk.o
@echo "Generating $@ ..."
@$(AR) -cr $@ $^
@$(RL) $@
@cp -f ${INCDIR}/fl_imgtk.h ${OUTDIR}
clean:
@echo "Cleaning built directories ..."
@rm -rf ${OBJDIR}/*
cleanlib:
@rm -rf ${OUTDIR}/${OUTBIN}