Lines 81-90
Link Here
|
81 |
|
81 |
|
82 |
# Flags that are mandatory to compile 'gmic'. |
82 |
# Flags that are mandatory to compile 'gmic'. |
83 |
MANDATORY_CFLAGS += -std=c++11 -Dgmic_build -I$(USR)/$(INCLUDE) |
83 |
MANDATORY_CFLAGS += -std=c++11 -Dgmic_build -I$(USR)/$(INCLUDE) |
84 |
MANDATORY_LIBS += -L$(USR)/$(LIB) |
|
|
85 |
ifeq ($(CC),g++) |
84 |
ifeq ($(CC),g++) |
86 |
MANDATORY_CFLAGS += -Wall -W |
85 |
MANDATORY_CFLAGS += -Wall -W |
87 |
MANDATORY_LIBS += -lm |
86 |
MANDATORY_LIBS = -lm |
88 |
endif |
87 |
endif |
89 |
MANDATORY_CFLAGS += $(IS_BETA_CFLAGS) |
88 |
MANDATORY_CFLAGS += $(IS_BETA_CFLAGS) |
90 |
ifeq ($(OS),Unix) |
89 |
ifeq ($(OS),Unix) |
Lines 136-149
Link Here
|
136 |
# (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). |
135 |
# (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). |
137 |
# This requires the presence of the X11 include and library files. |
136 |
# This requires the presence of the X11 include and library files. |
138 |
# (package 'libx11-dev' on Debian). |
137 |
# (package 'libx11-dev' on Debian). |
139 |
X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr |
138 |
X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" #-Dcimg_use_xrandr |
140 |
X11_LIBS = -L/usr/X11R6/lib -lX11 -lpthread #-lXrandr |
139 |
X11_LIBS = -lX11 -lpthread #-lXrandr |
141 |
|
140 |
|
142 |
# Flags to enable fast display, using XShm. |
141 |
# Flags to enable fast display, using XShm. |
143 |
# This requires the presence of the X11 extension include and library files. |
142 |
# This requires the presence of the X11 extension include and library files. |
144 |
# (package 'libx11-dev' on Debian). |
143 |
# (package 'libx11-dev' on Debian). |
145 |
XSHM_CFLAGS = -Dcimg_use_xshm |
144 |
XSHM_CFLAGS = -Dcimg_use_xshm |
146 |
XSHM_LIBS = -L$(USR)/X11R6/lib -lXext |
145 |
XSHM_LIBS = -lXext |
147 |
|
146 |
|
148 |
# Flags to enable image display, using GDI32. |
147 |
# Flags to enable image display, using GDI32. |
149 |
# This requires the presence of the GDI32 include and library files. |
148 |
# This requires the presence of the GDI32 include and library files. |
Lines 178-184
Link Here
|
178 |
# This requires the presence of the FFMPEG include and library files. |
177 |
# This requires the presence of the FFMPEG include and library files. |
179 |
# (packages 'libavcodec-dev', 'libavutil-dev', 'libavformat-dev' and 'libswscale-dev' on Debian). |
178 |
# (packages 'libavcodec-dev', 'libavutil-dev', 'libavformat-dev' and 'libswscale-dev' on Debian). |
180 |
FFMPEG_CFLAGS = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I$(USR)/$(INCLUDE)/libavcodec -I$(USR)/$(INCLUDE)/libavformat -I$(USR)/$(INCLUDE)/libswscale -I$(USR)/$(INCLUDE)/ffmpeg |
179 |
FFMPEG_CFLAGS = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I$(USR)/$(INCLUDE)/libavcodec -I$(USR)/$(INCLUDE)/libavformat -I$(USR)/$(INCLUDE)/libswscale -I$(USR)/$(INCLUDE)/ffmpeg |
181 |
FFMPEG_LIBS = -lavcodec -lavformat -lswscale |
180 |
FFMPEG_LIBS = -lavcodec -lavformat -lavutil -lswscale |
182 |
|
181 |
|
183 |
# Flags to enable native support for compressed .cimgz files, using the Zlib library. |
182 |
# Flags to enable native support for compressed .cimgz files, using the Zlib library. |
184 |
# This requires the presence of the Zlib include and library files. |
183 |
# This requires the presence of the Zlib include and library files. |
Lines 189-202
Link Here
|
189 |
# Flags to enable native support of webcams, using the OpenCV library. |
188 |
# Flags to enable native support of webcams, using the OpenCV library. |
190 |
# This requires the presence of the OpenCV include and library files. |
189 |
# This requires the presence of the OpenCV include and library files. |
191 |
# (package 'libcv3-2-dev' on Debian). |
190 |
# (package 'libcv3-2-dev' on Debian). |
192 |
ifeq ($(OS),Darwin) |
|
|
193 |
OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/$(INCLUDE) -I$(USR)/$(INCLUDE)/opencv |
194 |
OPENCV_LIBS = `pkg-config opencv --libs` #-> Use this for OpenCV 2.2.0 ! |
191 |
OPENCV_LIBS = `pkg-config opencv --libs` #-> Use this for OpenCV 2.2.0 ! |
195 |
else |
|
|
196 |
OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/$(INCLUDE) -I$(USR)/$(INCLUDE)/opencv |
197 |
# OPENCV_LIBS = -lcv -lhighgui |
198 |
OPENCV_LIBS = -lopencv_core -lopencv_highgui #-> Use this for OpenCV >= 2.2.0 ! |
199 |
endif |
200 |
|
192 |
|
201 |
# Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library. |
193 |
# Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library. |
202 |
# This requires the presence of the GraphicsMagick++ include and library files. |
194 |
# This requires the presence of the GraphicsMagick++ include and library files. |
Lines 368-389
Link Here
|
368 |
gmic_lib.o: gmic.cpp |
360 |
gmic_lib.o: gmic.cpp |
369 |
$(CC) -o gmic_lib.o -c gmic.cpp -fPIC $(CFLAGS) |
361 |
$(CC) -o gmic_lib.o -c gmic.cpp -fPIC $(CFLAGS) |
370 |
gmic_lib: gmic_lib.o |
362 |
gmic_lib: gmic_lib.o |
371 |
ar rcs libgmic.a gmic_lib.o |
363 |
$(AR) rcs libgmic.a gmic_lib.o |
372 |
ifneq ($(OS),Darwin) |
364 |
ifneq ($(OS),Darwin) |
373 |
$(CC) -shared -Wl,-soname,libgmic.so.1 -o libgmic.so gmic_lib.o $(LIBS) |
365 |
$(CC) $(LDFLAGS) -shared -Wl,-soname,libgmic.so.1 -o libgmic.so gmic_lib.o $(LIBS) |
374 |
$(CC) -o gmic_use_lib gmic_use_lib.cpp -L. -lgmic $(FFTW_LIBS) |
366 |
$(CC) -o gmic_use_lib gmic_use_lib.cpp -L. -lgmic $(FFTW_LIBS) |
375 |
else |
367 |
else |
376 |
$(CC) -shared -o libgmic.so gmic_lib.o $(LIBS) |
368 |
$(CC) $(LDFLAGS) -shared -o libgmic.so gmic_lib.o $(LIBS) |
377 |
endif |
369 |
endif |
378 |
|
370 |
|
379 |
gmic_gimp.o: gmic.cpp CImg.h |
371 |
gmic_gimp.o: gmic.cpp CImg.h |
380 |
$(CC) -o gmic_gimp.o -c gmic.cpp $(CFLAGS) -Dgmic_gimp |
372 |
$(CC) -o gmic_gimp.o -c gmic.cpp $(CFLAGS) -Dgmic_gimp |
381 |
gmic_gimp : gmic_gimp.o gmic_gimp.cpp |
373 |
gmic_gimp : gmic_gimp.o gmic_gimp.cpp |
382 |
$(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) `gimptool-2.0$(EXE) --libs` $(LIBS) |
374 |
$(CC) `gimptool-2.0$(EXE) --cflags` $(CFLAGS) $(LDFLAGS) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --libs` $(LIBS) |
383 |
strip gmic_gimp$(EXE) |
|
|
384 |
|
375 |
|
385 |
gmic: gmic.cpp gmic.h CImg.h |
376 |
gmic: gmic.cpp gmic.h CImg.h |
386 |
$(CC) -o gmic gmic.cpp $(CFLAGS) -Dgmic_main $(LIBS) |
377 |
$(CC) $(CFLAGS) -Dgmic_main $(LDFLAGS) -o gmic gmic.cpp $(LIBS) |
387 |
|
378 |
|
388 |
gmic_def.h: gmic_def.gmic |
379 |
gmic_def.h: gmic_def.gmic |
389 |
@echo "#ifndef gmic_gimp" > gmic_def.h |
380 |
@echo "#ifndef gmic_gimp" > gmic_def.h |