1
2
3#PREF_CCFLAGS 	+= $(CCOPTFLAG) ;		# Turn optimisation on
4PREF_CCFLAGS    += $(CCDEBUGFLAG) ;		# Debugging flags
5#PREF_CCFLAGS    += $(CCHEAPDEBUG) ;     # Heap Debugging & Debugging flags
6PREF_LINKFLAGS	+= $(LINKDEBUGFLAG) ;
7
8# Compile .c as .m
9if $(OS) = MACOSX {
10	ObjectCcFlags dispwin : -ObjC ;
11	ObjectCcFlags dispwin_dispwin : -ObjC ;
12}
13
14if [ GLOB [ NormPaths . ] : fastserio.c ]  {
15#	echo "!!!!!!!!! fastserio.c is enabled !!!!!!!!!" ;
16#	DEFINES += ENABLE_FTDI ;
17}
18
19MADVRSOURCE = ;
20
21# Setup the right hardware access libraries
22if $(NT) {
23	MADVRSOURCE = madvrwin.c ;
24
25	if $(USE_LIBUSB) = true {
26		DEFINES += USE_LIBUSB ;
27		if $(USE_LIBUSB1) = true {
28			DEFINES += USE_LIBUSB1 ;
29			LIBUSBDIR = ../libusb1 ;
30			LIBUSBHDRS = ../libusb1 ;
31			if $(MSVCNT) {
32				LIBUSBHDRS += ../libusb1/msvc ;	# So stdint.h can be found
33			}
34			if $(LIBUSB_IS_DLL) = true {
35				LIBUSB = $(LIBUSB1NAME)$(SUFIMPLIB) ;
36				LIBUSBSH = $(LIBUSB1NAME)$(SUFSHLIB) ;
37			} else {
38				LIBUSB = $(LIBUSB1NAME)$(SUFLIB) ;
39			}
40		} else {
41			LIBUSBDIR = ../libusbw ;
42			LIBUSBHDRS = ../libusbw ;
43			LIBUSB = libusb ;
44		}
45	} else {
46		LIBUSBHDRS = ../usb/driver ;	# libusb-win32 kernel driver info
47	}
48}
49
50if $(UNIX) {
51	if $(USE_LIBUSB)  = true {
52		DEFINES += USE_LIBUSB ;
53		if $(USE_LIBUSB1) = true {
54			DEFINES += USE_LIBUSB1 ;
55			LIBUSBDIR = ../libusb1 ;
56			LIBUSBHDRS = ../libusb1 ;
57			if $(LIBUSB_IS_DLL) = true {
58				LIBUSB = $(LIBUSB1NAME)$(SUFIMPLIB) ;
59				LIBUSBSH = $(LIBUSB1NAME)$(SUFSHLIB) ;
60			} else {
61				LIBUSB = $(LIBUSB1NAME)$(SUFLIB) ;
62			}
63		} else {
64			LIBUSBDIR = ../libusb ;
65			LIBUSBHDRS = ../libusb ;
66			LIBUSB = libusb ;
67		}
68	}
69	CONVFILE = pollem.c ;
70}
71
72#Products
73Libraries = libinsttypes libdisptechs libinst libdisp libconv libinstapp ;
74Executables = dispwin synthcal dispread dispcal fakeread synthread
75              chartread spotread illumread ccxxmake spec2cie average oeminst ;
76Headers = inst.h ;
77Samples = SOtele.sp linear.cal strange.cal ccxx.ti1 ;
78
79#Install
80InstallBin  $(DESTDIR)$(PREFIX)/bin : $(Executables) ;
81InstallFile $(DESTDIR)$(PREFIX)/$(REFSUBDIR) : $(Samples) ;
82#InstallFile $(DESTDIR)$(PREFIX)/h : $(Headers) ;
83#InstallLib  $(DESTDIR)$(PREFIX)/lib : $(Libraries) ;
84
85if $(UNIX) && $(OS) != MACOSX {
86	# Micro Unix CMM for handling monitor profile association
87	CMMHDRS = ../ucmm ;
88	CMMLIBS = ../ucmm/libucmm ../jcnf/libjcnf ../yajl/libyajl ;
89}
90
91HDRS = ../h ../numlib ../icc ../cgats ../rspl ../xicc ../gamut ../spectro
92       ../plot ../render ../ccast $(LIBUSBHDRS) $(CMMHDRS) ;
93
94# Instrument access library library
95SER_INSTS = dtp22.c dtp41.c dtp51.c ss.c ss_imp.c ;
96
97USB_INSTS = dtp20.c i1disp.c i1d3.c i1pro.c i1pro_imp.c
98                      munki.c munki_imp.c hcfr.c spyd2.c huey.c
99                      colorhug.c ex1.c usbio.c hidio.c ;
100
101FAST_SER_INSTS = specbos.c kleink10.c smcube.c ;
102
103SER_USB_INSTS = dtp92.c ;
104
105if $(USE_SERIAL) = true {
106	DEFINES += ENABLE_SERIAL ;
107	INST_SRCS += $(SER_INSTS) ;
108}
109
110if $(USE_USB) = true {
111	DEFINES += ENABLE_USB ;
112	INST_SRCS += $(USB_INSTS) ;
113}
114
115if $(USE_FAST_SERIAL) = true || $(USE_SERIAL) = true {
116	DEFINES += ENABLE_FAST_SERIAL ;
117	INST_SRCS += $(FAST_SER_INSTS) ;
118}
119
120if $(USE_SERIAL) = true || $(USE_USB) = true {
121	INST_SRCS += $(SER_USB_INSTS) ;
122}
123
124if $(USE_DEMOINST) = true && [ GLOB [ NormPaths . ] : demoinst.c ] {
125	echo "Compiling demo instrument support" ;
126	DEFINES += ENABLE_DEMOINST ;
127	INST_SRCS += demoinst.c ;
128}
129
130Library libinst : inst.c insttypes.c icoms.c disptechs.c rspec.c xrga.c $(INST_SRCS) ;
131
132# Display access library
133ObjectKeep mongoose.c ;
134Library libdisp : dispsup.c dispwin.c webwin.c ccwin.c
135                  $(MADVRSOURCE) : : : $(LibWinH) : mongoose ;
136
137# Instrument and Display types utility functions library. Use these instead of libinst when */
138# applications need to know about different instrument or display types, but not access them. */
139# (Note we're working around a bug in Jam caused by objects shared between libraries)
140Object insttypes2 : insttypes.c ;
141LibraryFromObjects libinsttypes : insttypes2 ;
142
143Object disptechs2 : disptechs.c ;
144LibraryFromObjects libdisptechs : disptechs2 ;
145
146# System utility functions (keyboard, msec_*, thread)
147Library libconv : xdg_bds.c aglob.c conv.c base64.c $(CONVFILE) : : : $(LibWinH) ;
148
149# Command line application instrument related convenience functions
150Library libinstapp : instappsup.c ;
151
152# Support file
153#Object alphix : ../target/alphix.c ;
154
155LINKLIBS = libinst libinstapp
156           ../xicc/libxcolorants ../xicc/libxicc
157           ../gamut/libgamut
158           ../rspl/librspl ../cgats/libcgats
159           ../icc/libicc ../plot/libplot ../plot/libvrml
160		   ../ccast/libccast $(SSLLIB) ../yajl/libyajl ../render/librender
161           $(TIFFLIB) $(JPEGLIB) $(PNGLIB) $(ZLIB)
162           ../numlib/libui ../numlib/libnum
163           $(CMMLIBS) libconv ;
164
165if $(LIBUSB_IS_DLL) = true {
166	LINKSHLIBS = $(LIBUSBDIR)/$(LIBUSB) ;
167	File $(LIBUSBSH) : $(LIBUSBDIR)/$(LIBUSBSH) ;
168	# executable needs .so/.dll in same directory
169	NDepends $(Executables) : $(LIBUSBSH) ;
170} else {
171	LINKLIBS += $(LIBUSBDIR)/$(LIBUSB) ;
172}
173
174# General target reader program
175Main chartread : chartread.c ../target/alphix.c : : : ../target : : ;
176
177# Illuminant measurement
178Main illumread : illumread.c : : : ../target : : ;
179
180# Printed target spot reader utility
181Main spotread : spotread.c : : : : : ;
182
183# Test code
184if $(HOME) = "d:\\usr\\graeme" && $(PWD) = "/src/argyll/spectro" {
185	Main setoem : setoem.c : : : : : ../numlib/libui ;
186}
187
188# CCMX and CCSStool
189Main ccxxmake : ccxxmake.c : : : : : libdisp ;
190
191# Gretag Spectroscan/T filmstrip reader
192#Main filmread : filmread.c : : : : : ;
193
194# Create synthetic .cal
195Main synthcal : synthcal.c ;
196
197# Display calibration program
198Main dispcal : dispcal.c : : : ../target : : libdisp ;
199
200# Display tester program
201Main dispread : dispread.c : : : : : libdisp ;
202
203#display test window test/Lut loader utility
204# [ Could avoid need for libinst libusb etc.
205#   by separating system dependent utils to a separate library .]
206MainVariant dispwin : dispwin.c webwin.c ccwin.c $(MADVRSOURCE) : : STANDALONE_TEST : : mongoose : $(LibWin) ;
207
208LINKLIBS = libinsttypes libdisptechs ../xicc/libxicc ../gamut/libgamut ../rspl/librspl
209           ../cgats/libcgats ../icc/libicc ../plot/libplot ../numlib/libnum ../numlib/libui
210           ../plot/libvrml ;
211
212# Fake device print/read utility using ICC profile
213Main fakeread : fakeread.c ;
214
215# Synthetic device print/read utility
216Main synthread : synthread.c ;
217
218# Add CIE values to a spectral reading file
219Main spec2cie : spec2cie.c ;
220
221# Average RGB or CMYK .ti3 files
222Main average : average.c ;
223
224# Utility to install ccmx's, ccss's or install from OEM EDR files
225Objects oemarch.c vinflate.c inflate.c LzmaDec.c mongoose.c ;
226Main oeminst : oeminst.c : : : : oemarch vinflate inflate LzmaDec : libconv ;
227
228# Generate linear.cal example/diagnostic
229# (NoUpdate so that Cross Compile Win64 hack works)
230NNoUpdate linear.cal ;
231GenFileND linear.cal : synthcal [ NormPaths linear ] ;
232NDepends exe : linear.cal ;	# Normally create it
233
234# Generate strange.cal example/diagnostic
235# (NoUpdate so that Cross Compile Win64 hack works)
236NNoUpdate strange.cal ;
237GenFileND strange.cal : synthcal -s 0.7,1.0,0.9 -p 1.7,0.8,0.7 [ NormPaths strange ] ;
238NDepends exe : strange.cal ;	# Normally create it
239
240# Dumy ti3 file generator for testing
241#Main dumyti3 : dumyti3.c ;
242
243# Test utility for XYZ matrix spectral correction
244#Main xyzfix : xyzfix.c ;
245
246# Individual stand alone test of xdg_bds library
247MainVariant xdg_bds : xdg_bds.c : : STANDALONE_TEST : : : libconv ;
248
249# fp conversion code test
250#Main fp : fp.c ;
251
252# test code
253#Main t : t.c ;
254#Main tt : tt.c ;
255#Main ttt : ttt.c ;
256#Main t1 : t1.c ;
257#Main tt : tt.c ;
258#Main t8 : t8.c ;
259#Main t9 : t9.c ;
260#Main i1d3eval : i1d3eval.c ;
261
262# Simple test code of aglob
263if [ GLOB [ NormPaths . ] : globtest.c ]  {
264	Main globtest : globtest.c : : : : : libconv ;
265}
266
267# reflect_db.txt parser */
268if [ GLOB [ NormPaths . ] : txt2sp.c ]  {
269	Main txt2sp : txt2sp.c ;
270}
271
272# SwatchMate Cube calibration
273if [ GLOB [ NormPaths . ] : cubecal.c ]  {
274	Main cubecal : cubecal.c ;
275}
276
277# ColorMeter utility
278if [ GLOB [ NormPaths . ] : oemdnld.c ]  {
279	echo "Found oemdnld.c !" ;
280	Main oemdnld : oemdnld.c : : : : oemarch vinflate inflate LzmaDec mongoose : libconv ;
281}
282
283# Test code
284if $(BUILD_JUNK) {
285
286	# /SUBSYSTEM:WINDOWS on NT link ?
287
288	#	Main fakeindev : fakeindev.c ;
289	#	Main cmtest : cmtest.c : : : : : libconv ;
290	#	Main webdisp : webdisp.c : : : : : libconv ;
291	# test for parsing a VISE archive
292	#Main visetest : visetest.c vinflate.c ;
293
294	# Compute deconvolution filter for i1pro
295	#Main i1deconv : i1deconv.c ;
296
297	# Compute stray light calibration for i1pro
298	#Main i1stray : i1stray.c ;
299}
300
301