summaryrefslogtreecommitdiff
path: root/Jamtop
blob: 3ba306b42cc0e864c29cc0710bea230f42585734 (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
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
159
160

# This holds the common definitions for Argyll that all the
# subdirectory jam's will include (even if run in the sub directory) 

Echo "Argyll Jamrules has been read" ;


# Default install base directory is same directory as Jamtop,
# but can be overriden in the command line.
DESTDIR ?= [ NormPaths  . ] ;

# Default prefix is empty, but can be overriden in the command line.
PREFIX ?= "" ;

# Default ref file sub-directory is "ref", but can be overriden in the command line.
REFSUBDIR ?= "ref" ;

Echo "DESTDIR = '$(DESTDIR)', PREFIX = '$(PREFIX)', REFSUBDIR = '$(REFSUBDIR)'" ;

# Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
ANCHORED_PATH_VARS = DESTDIR ;


# Tell standalone libraries that they are part of Argyll:
DEFINES += ARGYLLCMS ;

# enable serial instruments & support
USE_SERIAL = true ;	

# enable fast serial instruments & support
USE_FAST_SERIAL = true ;		# (Implicit in USE_SERIAL too)	

# enable USB instruments & support
USE_USB = true ;	

# enable dummy Demo Instrument, if code is available
USE_DEMOINST = true ;

# Use libusb (deprecated)
USE_LIBUSB = false ;

# Use libusb1 rather than libusb0 & libusb0-win32 (deprecated)
USE_LIBUSB1 = true ;

# Make the USB V1 library static
LIBUSB_IS_DLL = false ;

# Always use DLL for MSWin, because driver install expects it (.inf)
if $(NT) {
	LIBUSB_IS_DLL = true ;
}

# Set the libubs1 library name.
LIBUSB1NAME = libusb-1.0A ;

# Information for compiling and linking GUI programs

if $(UNIX) {
	if $(OS) = MACOSX {
		LINKFLAGS += -framework IOKit ;
		LINKFLAGS += -framework CoreFoundation ;
		LINKFLAGS += -framework AudioToolbox ;
		LINKFLAGS += -framework AppKit ;

	} else {
		if [ GLOB /usr/X11R6/include/X11 : X.h ] {
			LibWinH = /usr/X11R6/include ;
		} else if [ GLOB /usr/include/X11 : X.h ] {
			LibWinH = /usr/include ;
		} else if [ GLOB /usr/local/include/X11 : X.h ] {
			LibWinH = /usr/local/include ;
		} else {
			EXIT Unable to locate the X11 include files ;
		}

		if $(HOST64) {
			if [ GLOB /usr/X11R6/lib : libX11.so ] {
				LibWinD = /usr/X11R6/lib ;
			} else if [ GLOB /usr/lib/x86_64-linux-gnu : libX11.so ] {
				LibWinD = /usr/lib/x86_64-linux-gnu ;
			} else if [ GLOB /usr/lib64 : libX11.so ] {
				LibWinD = /usr/lib64 ;
			} else if [ GLOB /usr/lib : libX11.so ] {
				LibWinD = /usr/lib ;
			} else if [ GLOB /usr/local/lib : libX11.so ] {
				LibWinD = /usr/local/lib ;
			} else {
				ECHO Unable to locate the 64 bit X11 library files ;
			}
		} else {
			if [ GLOB /usr/X11R6/lib : libX11.so ] {
				LibWinD = /usr/X11R6/lib ;
			} else if [ GLOB /usr/lib : libX11.so ] {
				LibWinD = /usr/lib ;
			} else if [ GLOB /usr/local/lib : libX11.so ] {
				LibWinD = /usr/local/lib ;
			} else {
				ECHO Unable to locate the 32 bit X11 library files ;
			}
		}
		if $(OS) = FREEBSD {
			LINKFLAGS += -L$(LibWinD) -g -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss  -lusb ;
		} else {
			LINKFLAGS += -L$(LibWinD) -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss ;
		}
		# HDRS += $(LibWinH) ; 
	}
}

# See if we have a system TIFF library.
if ! $(BUILTIN_TIFF) && $(UNIX) {
	if [ GLOB /usr/include : tiffio.h ] || [ GLOB /usr/local/include : tiffio.h ]  {
		if  [ GLOB /usr/lib : libtiff.so ] || [ GLOB /usr/lib : libtiff.a ]
		 || [ GLOB /usr/lib64 : libtiff.so ] || [ GLOB /usr/lib64 : libtiff.a ]
		 || [ GLOB /usr/lib/x86_64-linux-gnu : libtiff.so ]
		 || [ GLOB /usr/lib/x86_64-linux-gnu : libtiff.a ]
		 || [ GLOB /usr/local/lib : libtiff.so ] || [ GLOB /usr/local/lib : libtiff.a ] { 
			echo "Using system TIFF library" ;
			TIFFLIB = ;
			TIFFINC = ;
			LINKFLAGS += $(LINKFLAG)tiff ;
			HAVE_TIFF = true ;
		}
	}
}

# If nothing else, use Argyll supplied TIFF library
if ! $(HAVE_TIFF) || $(BUILTIN_TIFF) {
	echo "Using Argyll TIFF library" ;
	TIFFLIB = ../tiff/libtiff.lib ;
	TIFFINC = ../tiff ;
}

# See if we have a system JPEG library.
if ! $(BUILTIN_JPEG) && $(UNIX) {
	if [ GLOB /usr/include : jpeglib.h ] || [ GLOB /usr/local/include : jpeglib.h ] {
		if  [ GLOB /usr/lib : libjpeg.so ] || [ GLOB /usr/lib : libjpeg.a ]
		 || [ GLOB /usr/lib64 : libjpeg.so ] || [ GLOB /usr/lib64 : libjpeg.a ]
		 || [ GLOB /usr/lib/x86_64-linux-gnu : libjpeg.so ]
		 || [ GLOB /usr/lib/x86_64-linux-gnu : libjpeg.a ]
		 || [ GLOB /usr/local/lib : libjpeg.so ] || [ GLOB /usr/local/lib : libjpeg.a ] {
			echo "Using system JPEG library" ;
			JPEGLIB = ;
			JPEGINC = ;
			LINKFLAGS += $(LINKFLAG)jpeg ;
			HAVE_JPEG = true ;
		}
	}
}

# If nothing else, use Argyll supplied JPEG library
if ! $(HAVE_JPEG) || $(BUILTIN_JPEG) {
	echo "Using Argyll JPEG library" ;
	JPEGLIB = ../jpg/libjpeg.lib ;
	JPEGINC = ../jpg ;
}

# testing
#DSTDIR = var ;
#SRCDIR = .. ;