forked from LibRaw/LibRaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.devel
158 lines (110 loc) · 6.76 KB
/
Makefile.devel
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
all: sources library all_samples dcraw_binaries
PP=./internal/preprocess.pl
CC=gcc
CXX=g++
#CFLAGS=-O4 -march=core2 -march=core2 -mtune=core2 -fomit-frame-pointer -ffast-math -fstrict-aliasing -funsafe-math-optimizations -mfpmath=sse -msse2 -I.
#CFLAGS=-g -Wall -I.
#CFLAGS=-g -I. -Wall
CFLAGS= -O4 -g -I. -Wall -Wno-long-long -Wno-conversion -Wno-sign-compare -Wno-overflow -fpack-struct=8 -fopenmp
#CFLAGS=-g -I. -Wall -Wno-long-long -Wno-conversion -Wno-sign-compare -fpack-struct=8 -fopenmp
# GCC 4.6 section
#CC=gcc46
#CXX=g++46
#CFLAGS= -O4 -g -march=corei7 -mtune=corei7 -I. -pedantic -Wno-long-long -Wno-overflow -msse4.2 -mfpmath=sse -fopenmp
#CFLAGS= -O -I. -pedantic -Wno-long-long -Wno-overflow -g
# LCMS support
# For lcms2 set -DUSE_LCMS2
#CFLAGS+=-DUSE_LCMS -I/usr/local/include
#LDADD+=-L/usr/local/lib -llcms
# Jasper support for RedCine
CFLAGS+=-DUSE_JASPER -I/usr/local/include
LDADD+=-L/usr/local/lib -ljasper
# JPEG support for DNG
CFLAGS+=-DUSE_JPEG -I/usr/local/include
LDADD+=-L/usr/local/lib -ljpeg
# Demosaic Pack GPL2:
DPCFLAGS+=-I../LibRaw-demosaic-pack-GPL2
CFLAGS+=-DLIBRAW_DEMOSAIC_PACK_GPL2
# Demosaic Pack GPL3:
DPCFLAGS+=-I../LibRaw-demosaic-pack-GPL3
CFLAGS+=-DLIBRAW_DEMOSAIC_PACK_GPL3
DCRAW_GEN= internal/dcraw_common.cpp internal/dcraw_fileio.cpp
DCRAW_LIB_OBJECTS=object/dcraw_common.o object/libraw_cxx.o object/libraw_datastream.o object/libraw_c_api.o object/dcraw_fileio.o object/demosaic_packs.o
DCRAW_LIB_MT_OBJECTS=object/dcraw_common_mt.o object/libraw_cxx_mt.o object/libraw_datastream_mt.o object/libraw_c_api_mt.o object/dcraw_fileio_mt.o object/demosaic_packs_mt.o
LR_INCLUDES=libraw/libraw.h libraw/libraw_alloc.h libraw/libraw_const.h libraw/libraw_datastream.h libraw/libraw_internal.h libraw/libraw_types.h libraw/libraw_version.h
sources: ${DCRAW_GEN} Makefile.devel ${PP}
library: lib/libraw.a lib/libraw_r.a
all_samples: bin/raw-identify bin/simple_dcraw bin/dcraw_emu bin/dcraw_half bin/half_mt bin/mem_image \
bin/unprocessed_raw bin/4channels bin/multirender_test bin/postprocessing_benchmark
## Demosaic Pack(s)
object/demosaic_packs.o: internal/demosaic_packs.cpp ${LR_INCLUDES}
$(CXX) -w -c -DLIBRAW_NOTHREADS ${CFLAGS} ${DPCFLAGS} -o object/demosaic_packs.o internal/demosaic_packs.cpp
object/demosaic_packs_mt.o: internal/demosaic_packs.cpp ${LR_INCLUDES}
$(CXX) -w -c -pthread ${CFLAGS} ${DPCFLAGS} -o object/demosaic_packs_mt.o internal/demosaic_packs.cpp
## Samples ##
bin/raw-identify: lib/libraw.a samples/raw-identify.cpp
$(CXX) ${CFLAGS} -o bin/raw-identify samples/raw-identify.cpp -L./lib -lraw -lm ${LDADD}
bin/simple_dcraw: lib/libraw.a samples/simple_dcraw.cpp
$(CXX) -DLIBRAW_NOTHREADS ${CFLAGS} -o bin/simple_dcraw samples/simple_dcraw.cpp -L./lib -lraw -lm ${LDADD}
bin/multirender_test: lib/libraw.a samples/multirender_test.cpp
$(CXX) -DLIBRAW_NOTHREADS ${CFLAGS} -o bin/multirender_test samples/multirender_test.cpp -L./lib -lraw -lm ${LDADD}
bin/postprocessing_benchmark: lib/libraw.a samples/postprocessing_benchmark.cpp
$(CXX) -DLIBRAW_NOTHREADS ${CFLAGS} -o bin/postprocessing_benchmark samples/postprocessing_benchmark.cpp -L./lib -lraw -lm ${LDADD}
bin/unprocessed_raw: lib/libraw.a samples/unprocessed_raw.cpp
$(CXX) -DLIBRAW_NOTHREADS ${CFLAGS} -o bin/unprocessed_raw samples/unprocessed_raw.cpp -L./lib -lraw -lm ${LDADD}
bin/4channels: lib/libraw.a samples/4channels.cpp
$(CXX) -DLIBRAW_NOTHREADS ${CFLAGS} -o bin/4channels samples/4channels.cpp -L./lib -lraw -lm ${LDADD}
bin/mem_image: lib/libraw.a samples/mem_image.cpp
$(CXX) ${CFLAGS} -o bin/mem_image samples/mem_image.cpp -L./lib -lraw -lm ${LDADD}
bin/dcraw_half: lib/libraw.a samples/dcraw_half.c
$(CC) ${CFLAGS} -o bin/dcraw_half samples/dcraw_half.c -L./lib -lraw -lm -lstdc++ ${LDADD}
bin/half_mt: lib/libraw_r.a samples/half_mt.c
$(CC) -pthread ${CFLAGS} -o bin/half_mt samples/half_mt.c -L./lib -lraw_r -lm -lstdc++ ${LDADD}
bin/dcraw_emu: lib/libraw.a samples/dcraw_emu.cpp
$(CXX) ${CFLAGS} -o bin/dcraw_emu samples/dcraw_emu.cpp -L./lib -lraw_r -lm ${LDADD}
dcraw_binaries: bin/dcraw_dist
bin/dcraw_dist: dcraw/dcraw.c Makefile.devel
$(CXX) -w -O4 -DLIBRAW_NOTHREADS -DNO_JPEG -DNO_LCMS -DNO_JASPER -I/usr/local/include -o bin/dcraw_dist dcraw/dcraw.c -lm -L/usr/local/lib
regenerate:
${PP} -N -DDEFINES dcraw/dcraw.c >internal/defines.h
${PP} -N -DCOMMON dcraw/dcraw.c >internal/dcraw_common.cpp
${PP} -N -DFILEIO dcraw/dcraw.c >internal/dcraw_fileio.cpp
internal/defines.h: dcraw/dcraw.c ${PP}
${PP} -DDEFINES dcraw/dcraw.c >internal/defines.h
internal/dcraw_common.cpp: dcraw/dcraw.c internal/defines.h ${PP} Makefile.devel
${PP} -DCOMMON dcraw/dcraw.c >internal/dcraw_common.cpp
internal/dcraw_fileio.cpp: dcraw/dcraw.c internal/defines.h ${PP} Makefile.devel
${PP} -DFILEIO dcraw/dcraw.c >internal/dcraw_fileio.cpp
object/dcraw_common.o: internal/dcraw_common.cpp ${LR_INCLUDES}
$(CXX) -c -DLIBRAW_NOTHREADS ${CFLAGS} ${LCMS_DEF} -o object/dcraw_common.o internal/dcraw_common.cpp
object/dcraw_fileio.o: internal/dcraw_fileio.cpp ${LR_INCLUDES}
$(CXX) -c -DLIBRAW_NOTHREADS ${CFLAGS} ${LCMS_DEF} -o object/dcraw_fileio.o internal/dcraw_fileio.cpp
object/libraw_cxx.o: src/libraw_cxx.cpp ${LR_INCLUDES}
$(CXX) -c -DLIBRAW_NOTHREADS ${LCMS_DEF} ${CFLAGS} -o object/libraw_cxx.o src/libraw_cxx.cpp
object/libraw_datastream.o: src/libraw_datastream.cpp ${LR_INCLUDES}
$(CXX) -c -DLIBRAW_NOTHREADS ${LCMS_DEF} ${CFLAGS} -o object/libraw_datastream.o src/libraw_datastream.cpp
object/libraw_c_api.o: src/libraw_c_api.cpp ${LR_INCLUDES}
$(CXX) -c -DLIBRAW_NOTHREADS ${LCMS_DEF} ${CFLAGS} -o object/libraw_c_api.o src/libraw_c_api.cpp
lib/libraw.a: ${DCRAW_LIB_OBJECTS}
rm -f lib/libraw.a
ar crv lib/libraw.a ${DCRAW_LIB_OBJECTS}
ranlib lib/libraw.a
lib/libraw_r.a: ${DCRAW_LIB_MT_OBJECTS}
rm -f lib/libraw_r.a
ar crv lib/libraw_r.a ${DCRAW_LIB_MT_OBJECTS}
ranlib lib/libraw_r.a
object/dcraw_common_mt.o: internal/dcraw_common.cpp ${LR_INCLUDES}
$(CXX) -c -pthread ${LCMS_DEF} ${CFLAGS} -o object/dcraw_common_mt.o internal/dcraw_common.cpp
object/dcraw_fileio_mt.o: internal/dcraw_fileio.cpp ${LR_INCLUDES}
$(CXX) -c -pthread ${LCMS_DEF} ${CFLAGS} -o object/dcraw_fileio_mt.o internal/dcraw_fileio.cpp
object/libraw_cxx_mt.o: src/libraw_cxx.cpp ${LR_INCLUDES}
$(CXX) -c ${LCMS_DEF} -pthread ${CFLAGS} -o object/libraw_cxx_mt.o src/libraw_cxx.cpp
object/libraw_datastream_mt.o: src/libraw_datastream.cpp ${LR_INCLUDES}
$(CXX) -c ${LCMS_DEF} -pthread ${CFLAGS} -o object/libraw_datastream_mt.o src/libraw_datastream.cpp
object/libraw_c_api_mt.o: src/libraw_c_api.cpp ${LR_INCLUDES}
$(CXX) -c ${LCMS_DEF} -pthread ${CFLAGS} -o object/libraw_c_api_mt.o src/libraw_c_api.cpp
clean:
rm -fr bin/*.dSYM
rm -f *.o *~ src/*~ samples/*~ internal/*~ libraw/*~ lib/lib*.a bin/[4a-z]* object/*o dcraw/*~ doc/*~ bin/*~
fullclean: clean
rm -f ${DCRAW_GEN}