summaryrefslogtreecommitdiff
blob: 047c6124a16274c0e16eec7ceee84aaab4536810 (plain)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
--- gmic-1.5.0.4/src/Makefile.orig
+++ gmic-1.5.0.4/src/Makefile
@@ -87,7 +87,7 @@
 
 # Flags that are mandatory to compile 'gmic'.
 MANDATORY_CFLAGS += -Dgmic_build -I$(USR)/include
-MANDATORY_LDFLAGS += -L$(USR)/lib
+MANDATORY_LDFLAGS +=
 ifeq ($(IS_GCC),yes)
 MANDATORY_CFLAGS += -Wall -W
 MANDATORY_LDFLAGS += -lm
@@ -98,21 +98,21 @@
 DEBUG_CFLAGS = -Dcimg_use_vt100 -Dcimg_verbosity=3 -g
 
 # Flags to enable optimizations.
-ifeq ($(IS_GCC),yes)
-OPT_CFLAGS = -O3 -fno-tree-pre # -ffast-math
-endif
-ifeq ($(CC),icc)
-OPT_CFLAGS = -O3 -ipo -no-prec-div -override-limits
-endif
+#ifeq ($(IS_GCC),yes)
+#OPT_CFLAGS = -O3 -fno-tree-pre # -ffast-math
+#endif
+#ifeq ($(CC),icc)
+#OPT_CFLAGS = -O3 -ipo -no-prec-div -override-limits
+#endif
 
 # Flags to enable image display, using X11
 # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too).
 X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr
-X11_LDFLAGS = -L/usr/X11R6/lib -lX11 -lpthread #-lXrandr
+X11_LDFLAGS = -lX11 -lpthread #-lXrandr
 
 # Flags to enable fast display, using XShm.
 XSHM_CFLAGS = -Dcimg_use_xshm
-XSHM_LDFLAGS = -L$(USR)/X11R6/lib -lXext
+XSHM_LDFLAGS = -lXext
 
 # Flags to enable image display, using GDI32.
 GDI32_CFLAGS = -Dcimg_display=2 -Dcimg_appname=\\\"gmic\\\"
@@ -144,12 +144,7 @@
 
 # Flags to enable native support of webcams, using the OpenCV library.
 OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/include/opencv
-ifeq ($(OS),Darwin)
 OPENCV_LDFLAGS = -lopencv_core -lopencv_highgui   # Use this for OpenCV 2.2.0 !
-else
-OPENCV_LDFLAGS = -lcv -lhighgui
-# OPENCV_LDFLAGS = -lopencv_core -lopencv_highgui   # Use this for OpenCV 2.2.0 !
-endif
 
 # Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library.
 MAGICK_CFLAGS = -Dcimg_use_magick -I$(USR)/include/GraphicsMagick
@@ -183,11 +178,11 @@
 	           $(EXR_LDFLAGS) $(FFTW_LDFLAGS) $(OPENCV_LDFLAGS) # $(FFMPEG_LDFLAGS) $(XSHM_LDFLAGS) # $(MAGICK_LDFLAGS)
 
 CUST_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \
-                   $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(MINC2_CFLAGS) $(ZLIB_CFLAGS) $(OPENCV_CFLAGS) \
-	           $(FFTW_CFLAGS) $(FFMPEG_CFLAGS) $(BOARD_CFLAGS) $(EXR_CFLAGS) $(MAGICK_CFLAGS) 
+                   $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) $(OPENCV_CFLAGS) \
+	           $(FFTW_CFLAGS) $(FFMPEG_CFLAGS) $(EXR_CFLAGS) $(MAGICK_CFLAGS) 
 CUST_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) $(PNG_LDFLAGS) \
-                    $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(MINC2_LDFLAGS) $(ZLIB_LDFLAGS) $(OPENCV_LDFLAGS) \
-	    	    $(FFTW_LDFLAGS) $(FFMPEG_LDFLAGS) $(BOARD_LDFLAGS) $(EXR_LDFLAGS) $(MAGICK_LDFLAGS) 
+                    $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(ZLIB_LDFLAGS) $(OPENCV_LDFLAGS) \
+	    	    $(FFTW_LDFLAGS) $(FFMPEG_LDFLAGS) $(EXR_LDFLAGS) $(MAGICK_LDFLAGS) 
 
 DEBUG_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \
                     $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) $(FFTW_CFLAGS) \
@@ -213,7 +208,7 @@
 STD_WINDOWS_LDFLAGS = $(MANDATORY_LDFLAGS) $(GDI32_LDFLAGS) $(ZLIB_LDFLAGS) $(PNG_LDFLAGS) $(JPEG_LDFLAGS) $(FFTW_LDFLAGS)
 
 STD_GIMP_CFLAGS = -Dgmic_build -Dcimg_display=0 -I$(USR)/include $(FFTW_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS) ${IS_BETA_CFLAGS}
-STD_GIMP_LDFLAGS = -L$(USR)/lib -lpthread $(FFTW_LDFLAGS) $(PNG_LDFLAGS) $(ZLIB_LDFLAGS)
+STD_GIMP_LDFLAGS = -lpthread $(FFTW_LDFLAGS) $(PNG_LDFLAGS) $(ZLIB_LDFLAGS)
 ifeq ($(OS),MINGW32_NT-5.1)
 STD_GIMP_LDFLAGS += -mwindows
 endif
@@ -254,10 +249,10 @@
 endif
 
 gimp:
-	$(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_GIMP_LDFLAGS) $(OPT_LDFLAGS)" "STRIP_EXE=1" gmic_gimp
+	$(MAKE) "CFLAGS+=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_GIMP_LDFLAGS) $(OPT_LDFLAGS)" gmic_gimp
 
 lib:
-	$(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_LIB_LDFLAGS)" gmic_lib
+	$(MAKE) "CFLAGS+=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_LIB_LDFLAGS)" gmic_lib
 
 # Entries for non-default configurations.
 minimal:
@@ -267,10 +262,10 @@
 	$(MAKE) "CFLAGS+=$(DEBUG_UNIX_CFLAGS)" "LDFLAGS+=$(DEBUG_UNIX_LDFLAGS)" gmic_minimal
 
 linux:
-	$(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS)" "STRIP_EXE=1" gmic_gmic
+	$(MAKE) "CFLAGS+=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_UNIX_LDFLAGS)" gmic_gmic
 
 custom:
-	$(MAKE) "CFLAGS=$(CUST_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(CUST_UNIX_LDFLAGS)" "STRIP_EXE=1" gmic_gmic
+	$(MAKE) "CFLAGS+=$(CUST_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(CUST_UNIX_LDFLAGS)" gmic_gmic
 
 solaris:
 	$(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS) -R$(USR)/X11R6/lib -lrt -lnsl -lsocket" "STRIP_EXE=1" gmic_gmic
@@ -288,7 +283,7 @@
 gmic_lib.o: gmic.cpp gmic_def.h
 	$(CC) -o gmic_lib.o -c gmic.cpp -fPIC -Dgmic_minimal -Dgmic_float $(CFLAGS)
 gmic_lib: gmic_lib.o
-	ar rcs libgmic.a gmic_lib.o
+	$(AR) rcs libgmic.a gmic_lib.o
 	$(CC) -shared -Wl,-soname,libgmic.so.1 -o libgmic.so gmic_lib.o $(LDFLAGS)
 	$(CC) -o gmic_use_lib gmic_use_lib.cpp -L. -lgmic $(FFTW_LDFLAGS)
 
@@ -296,7 +291,6 @@
 	$(CC) -o gmic_gimp.o -c gmic.cpp -Dgmic_gimp -Dgmic_minimal -Dgmic_float $(CFLAGS)
 gmic_gimp : gmic_gimp.o gmic_gimp.cpp
 	$(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) `gimptool-2.0$(EXE) --libs` $(LDFLAGS)
-	strip gmic_gimp$(EXE)
 
 gmic_minimal: gmic.cpp
 	$(CC) -o gmic gmic.cpp -Dgmic_minimal -Dgmic_float -Dgmic_main $(CFLAGS) $(LDFLAGS)
@@ -321,7 +315,6 @@
 	$(CC) -o gmic_double.o -c gmic.cpp -Dgmic_separate_compilation -Dgmic_double $(CFLAGS)
 gmic_gmic: gmic.cpp gmic_bool.o gmic_uchar.o gmic_char.o gmic_ushort.o gmic_short.o gmic_uint.o gmic_int.o gmic_float.o gmic_double.o gmic_def.h
 	$(CC) -o gmic gmic.cpp -Dgmic_separate_compilation -Dgmic_main $(CFLAGS) gmic_bool.o gmic_uchar.o gmic_char.o gmic_ushort.o gmic_short.o gmic_uint.o gmic_int.o gmic_float.o gmic_double.o $(LDFLAGS)
-	strip gmic$(EXE)
 
 def:
 	@echo "#ifndef gmic_gimp" > gmic_def.h