File: Makefile.std

package info (click to toggle)
xloadimage 4.1-25
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,820 kB
  • sloc: ansic: 36,084; asm: 284; makefile: 282; sh: 280
file content (215 lines) | stat: -rw-r--r-- 6,525 bytes parent folder | download | duplicates (19)
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Makefile for xloadimage.  this replaces the multiple makefiles used in
# versions prior to xloadimage 2.00.
#
# WARNING: if you use gcc 1.37, there is an optimizer bug which causes GIF
# images to come out black and colormap reduction to fail.  Use gcc-1-37 as
# your make target if you have gcc 1.37.

# Include system configuration parameters
include Make.conf

CFLAGS=$(OPT_FLAGS) $(CC_FLAGS) $(CC_CONFIG_FLAGS) $(X11_INC_DIR) \
  -DSYSPATHFILE=\"$(SYSPATHFILE)\"
LIBS=$(X11_LIB_DIR) $(X11_LIB_NAME) $(SYS_LIBS) -lm

# stuff that should eventually make the configuration file
SYSPATHFILE=/usr/lib/X11/Xloadimage

default: configure$(CONFIG_STYLE)
	$(MAKE) xloadimage
	$(MAKE) uufilter

# this target gets hit automatically on the first run; it sets up
# the Make.conf file and recursively calls make.

autoconfig: autoconfig.c
	$(CC) -g -o autoconfig autoconfig.c

# manual configuration target
configure:: autoconfig
	./autoconfig
	$(MAKE) configure-libraries

# this is the default target for the initial compilation
configure-auto:: autoconfig
	./autoconfig
	$(MAKE) configure-libraries

# target that doesn't do anything	
configure-skip::
	@echo "Already configured, skipping configuration process."

configure-clean:: autoconfig
	./autoconfig -clean
	echo "# this will contain information generated by libconfig" > jpeg.conf
	echo "# this will contain information generated by libconfig" > tiff.conf
	cd jpeg ; make clean
	cd tiff ; make clean

# specific configurations
configure-bsd:: autoconfig
	./autoconfig -bsd
	$(MAKE) configure-libraries

configure-sysv:: autoconfig
	./autoconfig -sysv
	$(MAKE) configure-libraries

# this program configures optional libraries
configure-libraries::
	$(CC) $(CC_FLAGS) -g -o libconfig libconfig.c
	./libconfig "$(CC)" "$(OPT_FLAGS)"

MISC= Imakefile Makefile Makefile.std VMS_BUILD.COM README build-imake \
      build-vms build-info buildshar.c packtar.c xloadimage.man \
      xloadimage.txt autoconfig.c Make.conf libconfig.c \
      makefloppy jpeg.c tiff.c uufilter.man uufilter.txt uufilter.c \
      xloadimagerc

# files for the loader library
LOADER_HDRS= cmuwmraster.h fbm.h gif.h imagetypes.h img.h \
             kljcpyrght.h mac.h mcidas.h mit.cpyrght mrmcpyrght.h \
             niff.h pbm.h pcx.h pds.h rle.h sunraster.h xwd.h tgncpyrght.h 
LOADER_SRCS= cmuwmraster.c faces.c fbm.c gif.c imagetypes.c img.c \
             mac.c mcidas.c mc_tables.c pbm.c pcx.c pdsuncomp.c \
             rle.c rlelib.c sunraster.c vff.c vicar.c xbitmap.c xpixmap.c \
             xwd.c
LOADER_OBJS= ${LOADER_SRCS:.c=.o}

# files for the image library
IMAGE_HDRS= copyright.h image.h
IMAGE_SRCS= new.c niff.c value.c zio.c
IMAGE_OBJS= ${IMAGE_SRCS:.c=.o}

# files for the image processing library
PROCESS_HDRS=
PROCESS_SRCS= bright.c clip.c compress.c dither.c fill.c halftone.c \
              merge.c reduce.c rotate.c smooth.c undither.c zoom.c
PROCESS_OBJS= ${PROCESS_SRCS:.c=.o}

OPTIONAL_OBJS= ${OPTIONAL_SRCS:.c=.o}

# files for xloadimage (X display utility)
X_HDRS= options.h patchlevel xloadimage.h
X_SRCS= config.c misc.c options.c root.c send.c window.c \
        xloadimage.c
X_OBJS= ${X_SRCS:.c=.o}

INCS= $(IMAGE_HDRS) $(LOADER_HDRS) $(PROCESS_HDRS) $(X_HDRS)
SRCS= $(IMAGE_SRCS) $(LOADER_SRCS) $(PROCESS_SRCS) $(X_SRCS) $(OPTIONAL_SRCS)
OBJS= $(IMAGE_OBJS) $(LOADER_OBJS) $(PROCESS_OBJS) $(X_OBJS) $(OPTIONAL_OBJS)

ALL= $(MISC) $(INCS) $(SRCS)

.c.o: Make.conf xloadimage.h image.h $*.c
	$(CC) -c $(CFLAGS) $*.c

jpeg.o: Make.conf image.h
	$(CC) -c $(CFLAGS) -Ijpeg $*.c

uufilter: uufilter.c
	$(CC) -o uufilter $(CFLAGS) uufilter.c

xloadimage: $(OBJS) $(OPTIONAL_LIBS)
	./build-info
	$(CC) -c $(CFLAGS) build.c
	$(CC) -o xloadimage $(CFLAGS) build.o $(OBJS) $(OPTIONAL_LIBS) $(LIBS)

install:: $(SYSPATHFILE) uufilter
	$(RM) $(INSTALLDIR)/xloadimage
	$(RM) $(INSTALLDIR)/xsetbg
	$(RM) $(INSTALLDIR)/xview
	$(RM) $(INSTALLDIR)/uufilter
	$(CP) xloadimage $(INSTALLDIR)/xloadimage
	$(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
	$(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
	$(CP) uufilter $(INSTALLDIR)/uufilter

clean::
	rm -f autoconfig
	make configure-clean
	rm -f *.o *~ xloadimage uufilter autoconfig libconfig packtar \
	  buildshar doshar shar.* *.tar *.tar.Z *.tc

$(SYSPATHFILE):
	@echo "*** Creating default $(SYSPATHFILE) since you"
	@echo "*** don't have one. This file is used to set up default places"
	@echo "*** and names to look for images.  You probably want to edit"
	@echo "*** it for your site.  See the xloadimage manual page for"
	@echo "*** details on the contents of this file."
	cp xloadimagerc $(SYSPATHFILE)

# this is for building Imakefiles and such for distributions

new-auxiliaries:: clean
	rm -f Imakefile Makefile.std VMS_BUILD.COM xloadimage.txt
	cp Makefile Makefile.std # backup in case they want it
	./build-imake "$(SRCS)" "$(OBJS)"
	./build-vms "$(SRCS)" "$(OBJS)"
	./default-info
	nroff -Tcrt -man xloadimage.man > xloadimage.txt
	nroff -Tcrt -man uufilter.man > uufilter.txt

# these targets are for building shar distributions

buildshar: buildshar.o
	$(CC) -o buildshar buildshar.o

shar:: buildshar new-auxiliaries
	rm -f shar.* doshar
	./buildshar $(ALL) > doshar
	sh doshar
	rm -f doshar Makefile.std

# targets for building tar distributions

packtar: packtar.c
	$(CC) -o packtar packtar.c

tar:: new-auxiliaries packtar
	./packtar $(ALL) sample/* jpeg/* tiff/*
	rm -f Imakefile Makefile.std

tar.Z: tar
	compress xloadimage.tar

# create a floppy-disk distribution.

floppy: new-auxiliaries
	./makefloppy $(ALL) sample
	./makefloppy tiff
	./makefloppy jpeg
	rm -f Imakefile Makefile.std

# these targets are for those of us who have CodeCenter/Saber-C

# load all objects in CodeCenter.

cl_obj: $(DEBUG_OBJS)
	#setopt ccargs -g $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
	#setopt load_flags $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
	#load build.o $(OBJS) $(OPTIONAL_LIBS) $(LIBS)
	#link

# load all sources in CodeCenter.

cl_src:
	#setopt ccargs -g $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
	#setopt load_flags $(CC_FLAGS) $(X11_INC_DIR) -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
	#load build.c $(SRCS) $(OPTIONAL_LIBS) $(LIBS)
	#link

# proof xloadimage using TestCenter.

xloadimage.tc:
	proof -errors $(CC) -o xloadimage.tc build.o $(CFLAGS) $(OBJS) $(OPTIONAL_LIBS) $(LIBS)

jpeg/libjpeg.a:
	cd jpeg ; $(MAKE) libjpeg.a

tiff/libtiff.a:
	cd tiff ; $(MAKE) libtiff.a

# a few dependencies
imagetypes.o: imagetypes.h imagetypes.c