1#
2# Makefile for LUG
3#
4# (c) 1992, Raul Rivero
5#
6# Makefile for the LUG Library     -->     SGI version
7#
8#
9#    ********************************************************
10#    *                                                      *
11#    *  Check include/lugconfig.h for internal defines !!!  *
12#    *                                                      *
13#    ********************************************************
14#
15
16###                                                                         ###
17#                                                                             #
18# Thank you for the ideas and additional configurations to the people at lune #
19#                                                                             #
20###                                                                         ###
21
22
23# Shell
24SHELL = /bin/sh
25
26#
27# Directories of LUG package.
28#
29DIRS = convert lib show utils
30
31#
32# Uncomment next line if you are using other compiler (e.g. gcc)
33#
34CC = cc
35
36#
37# Compiler options ( only C-O-M-P-I-L-E-R, not LUG options ).
38#
39COPTS = +z +O3 -Aa -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE
40
41#
42# Location of LUG header files.
43#
44LUGINC = -I../include
45LUGLIB = -L.. -llug
46
47#
48# Where lug library will live
49#
50LIBLUGDEST =  /usr/local/lib
51
52#
53# If you have installed the Utah Raster Toolkit library define
54# next variables, example:
55#
56#       URTINC = -I/usr/local/include/urt
57#       URTLIB = -L/usr/local/lib -lrle
58#       URTDEF = -DiRLE
59#
60# , or leave undefined if you don't have it.
61#
62URTINC = -I/usr/local/include/urt
63URTLIB = -L/usr/local/lib -lrle
64URTDEF = -DiRLE
65
66#
67# If you have installed the Sam Leffler's TIFF library define
68# next variables, example:
69#
70#       TIFFINC = -I/usr/local/include/tiff
71#       TIFFLIB = -L/usr/local/lib -ltiff
72#       TIFFDEF = -DiTIFF
73#
74# , or leave undefined if you don't have it.
75#
76TIFFINC = -I/usr/local/include/tiff
77TIFFLIB = -L/usr/local/lib -ltiff
78TIFFDEF = -DiTIFF
79
80#
81# If you have installed the JPEG library define
82# next variables, example:
83#
84#       JPEGINC = -I/usr/local/include/jpeg
85#       JPEGLIB = -L/usr/local/lib -ljpeg
86#       JPEGDEF = -DiJPEG
87#
88# , but if you already has installed the new (5.*) IJL library
89# change the last on with:
90#
91#       JPEGDEF = -DiJPEGNEW
92#
93# , or leave undefined if you don't have it.
94#
95JPEGINC = -I/usr/local/include/jpeg
96JPEGLIB = -L/usr/local/lib -ljpeg
97JPEGDEF = -DiJPEGNEW
98
99#
100# If your machine is a SGI computer define next variables, ... ok,
101# ok, an example:
102#
103#       SGIINC = -I/usr/include/gl
104#       SGILIB = -limage
105#       SGIDEF = -DiSGI
106#
107# , else leave undefined.
108#
109SGIINC =
110SGILIB =
111SGIDEF =
112
113#
114# Define what kind of viwer you'll support. Options are:
115#
116#       Machine                  Add
117#       -------                  ---
118#       hp9000                  -DiHP
119#       sgi/aix                 -DiGL
120#       pc                      -DiPC
121#       x11                     -DiX11
122#       vfr ( sgi )             -DiVFR   <-- SGI's Video Framer needs hardware
123#       linux			-DiLINUX
124#
125# Probably, also you'll need give a path to the headers.
126#
127# And example: we have a SGI with X11 and a Video FRamer, so
128# we define...
129#
130#       VIEWDEF = -DiGL -DiVFR
131#       VIEWLIB = -lgl_s -lvfr
132#       VIEWINC = -I/usr/include/gl -I/usr/video/vfr/src/inc
133#
134VIEWINC = -I/usr/include/X11R5
135VIEWLIB = -L/usr/lib/X11R5 -lX11
136VIEWDEF = -DiX11
137
138#
139# Final includes ( don't touch this ! ).
140#
141INCS = $(LUGINC) $(URTINC)  $(TIFFINC) $(JPEGINC) $(SGIINC)  $(VIEWINC)
142LIBS = $(LUGLIB) $(URTLIB)  $(TIFFLIB) $(JPEGLIB) $(VIEWLIB) -lm
143DEFS =           $(URTDEF)  $(TIFFDEF) $(JPEGDEF) $(SGIDEF)  $(VIEWDEF)
144
145#
146# Library objects.
147#
148OBJS =  convert/cnv.o           convert/encodgif.o      convert/gif.o   \
149        convert/heightfield.o   convert/jpeg.o          convert/pbm.o   \
150        convert/pcx.o           convert/pix.o           convert/ps.o    \
151        convert/raw.o           convert/rgb.o           convert/rla.o   \
152        convert/rle.o           convert/sgi.o           convert/tga.o   \
153        convert/tiff.o          lib/bitmap.o            lib/error.o     \
154        lib/general.o           lib/in_out.o            lib/memory.o    \
155        show/hp.o               show/pc.o               show/sgi.o      \
156        show/vfr.o              show/x11.o              utils/blur.o    \
157        utils/change.o          utils/chroma.o          utils/cut.o     \
158        utils/dither.o          utils/flip.o            utils/gamma.o   \
159        utils/histoequal.o      utils/hsl.o             utils/mask.o    \
160        utils/medianfilter.o    utils/mirror.o          utils/paste.o   \
161        utils/quantize.o        utils/rotate.o          utils/sharpen.o \
162        utils/slowzoom.o        utils/solid.o           utils/to24.o    \
163        utils/tobw.o            utils/tohalftone.o      utils/toinverse.o \
164        utils/zoom.o 		utils/convolve.o	show/linux.o
165
166all:	        liblug.a liblug.sl example
167
168
169clean:;		rm -f $(OBJS) liblug.a
170		( cd examples; $(MAKE) clean )
171
172install:        liblug.a liblug.sl
173		@echo "Installing library..."
174		@if [ ! -d $(LIBLUGDEST) ]; \
175		then \
176			mkdir $(LIBLUGDEST); \
177			chmod 755 $(LIBLUGDEST); \
178		fi; \
179		cp liblug.a $(LIBLUGDEST); \
180		chmod 644 $(LIBLUGDEST)/liblug.a; \
181		cp liblug.sl $(LIBLUGDEST); \
182		chmod 755 $(LIBLUGDEST)/liblug.sl
183		@echo "OK."
184
185archive:;	( cd .. ; tar cvf lug-1.0.tar lug ; compress lug-1.0.tar )
186
187liblug.a:;	@for i in $(DIRS); do \
188			( cd $$i ; make "INCS=$(INCS)" "DEFS=$(DEFS)" "CC=$(CC)" "COPTS=$(COPTS)" ) ; \
189		done;
190		ar scr liblug.a $(OBJS)
191###             ranlib liblug.a
192
193liblug.sl:	liblug.a
194		ld -s -b -o liblug.sl $(OBJS)
195
196example: 	liblug.a
197		( cd examples; make "INCS=$(LUGINC)" "LIBS=$(LIBS)" "CC=$(CC)" "COPTS=$(COPTS)" )
198
199