forked from dgtlrift/hp2xx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
os2.mak
335 lines (291 loc) · 9.3 KB
/
os2.mak
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
/##########################################################################
# Copyright (c) 1991 - 1994 Heinz W. Werntges. All rights reserved.
# Parts Copyright (c) 1999 Martin Kroeker All rights reserved.
# Distributed by Free Software Foundation, Inc.
#
# This file is part of HP2xx.
#
# HP2xx is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
# to anyone for the consequences of using it or for whether it serves any
# particular purpose or works at all, unless he says so in writing. Refer
# to the GNU General Public License, Version 2 or later, for full details
#
# Everyone is granted permission to copy, modify and redistribute
# HP2xx, but only under the conditions described in the GNU General Public
# License. A copy of this license is supposed to have been
# given to you along with HP2xx so you can know your rights and
# responsibilities. It should be in a file named COPYING. Among other
# things, the copyright notice and this notice must be preserved on all
# copies.
###########################################################################
#
# Generic Makefile for misc. versions of hp2xx; strong emphasis on UNIXes
#
# Utilities etc.:
#
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MKINFO = makeinfo
RMCMD = rm -f
STRIP = strip
# Installation sites (GNU conventions):
#
prefix = /usr/local
bindir = $(prefix)/bin
includedir = $(prefix)/include
mandir = $(prefix)/man
man1dir = $(mandir)/man1
infodir = $(prefix)/info
# CC and CFLAGS set for gcc, but any ANSI-C compiler should work.
# For non-gcc compilers, simply set CFLAGS = -O (to start with)
#
CC = gcc
CFLAGS = -O2 -I/usr/X11R6/include $(DEFINES) $(EX_DEFS) -Wall -pedantic -Wuninitialized -Wreturn-type -Wmissing-prototypes -Wstrict-prototypes
#CFLAGS = +O1 -Aa -D_HPUX_SOURCE -DSYSV -I/usr/include/X11R5 -I/usr/include/X11R4 $(DEFINES)
LFLAGS = -L/usr/X11R6/lib # only sometimes needed; see below for examples
CPPFLAGS = -I. # only sometimes needed; see below for examples
BINDCMD = # only needed for EMX and DJGPP DOS extenders
#############################################################################
# MAIN CONFIGURATION TASK:
# Define the target machine / OS by uncommenting the appropriate lines below.
# Remember to comment-out the defaults (a) if they do not apply!
#
# Generic UNIX + X11 previewer (default)
# add -lpng -lz for PNG support
# and/or -ltiff for TIFF
#
DEFINES = -DUNIX -DHAS_UNIX_X11
PREVIEWER = to_x11
ALL_LIBS = -L/usr/lib/X11R6 -lX11 -lm #-lpng -lz -ltiff
#
# Generic UNIX, no previewer
#
# DEFINES = -DUNIX
# PREVIEWER = no_prev
# ALL_LIBS = -lm
#
# Convex-OS
#
# DEFINES = -DUNIX -DHAS_UNIX_X11
# PREVIEWER = to_x11
# ALL_LIBS = -lX11 -lm
# CC = cc
# CFLAGS = -O
#
# SunOS + X11 previewer
#
# LFLAGS = -L$(OPENWINHOME)/lib
# CPPFLAGS = -I$(OPENWINHOME)/include
# DEFINES = -DUNIX -DHAS_UNIX_X11
# PREVIEWER = to_x11
# ALL_LIBS = -lX -lm
#
# SunOS + Sunview previewer
#
# DEFINES = -DUNIX -DHAS_UNIX_SUNVIEW
# PREVIEWER = to_sunvw
# ALL_LIBS = -lsunwindow -lsuntool -lpixrect -lm
#
# OS/2 2.x + PM previewer with stderr output, gcc/emx
#
DEFINES = -DOS2 -DHAS_OS2_PM -D__ST_MT_ERRNO__ -Zbin-files -Zmtd
PREVIEWER = to_pm
ALL_LIBS = -los2 -lm
BINDCMD = emxbind -w c:/emx/bin/emxl.exe $(PROGRAM)
#
# OS/2 2.x + PM previewer without stderr output, gcc/emx
#
#DEFINES = -DOS2 -DHAS_OS2_PM
#PREVIEWER = to_pm
#ALL_LIBS = -los2 -lm
#BINDCMD = emxbind -p c:/emx/bin/emxl.exe $(PROGRAM)
#
# OS/2 2.x + EMX full-screen previewer
#
#DEFINES = -DOS2 -DHAS_OS2_EMX
#PREVIEWER = to_os2
#ALL_LIBS = -los2 -lm
#BINDCMD = emxbind -f c:/emx/bin/emxl.exe $(PROGRAM) -ac
#
# OS/2 2.x + EMX + XFree86/OS2 X11 previewer
#
#DEFINES = -DUNIX -DHAS_UNIX_X11 -D__ST_MT_ERRNO__
#PREVIEWER = to_x11
#ALL_LIBS = -lX11 -lm
#LFLAGS = -Zmtd
#BINDCMD = emxbind -w c:/emx/bin/emxl.exe $(PROGRAM)
#
#--------------------------------------------------------------------------
# Below find *fragments* of how to augment this makefile for other systems.
# Note that I simply collected all definitions I am currently aware of,
# but that this collection is still subject to change.
#
# You are welcome to improve it!
#
# Note also that most of the systems listed below are already supported
# by special makefiles, though I'd like to make these obsolete by a
# future version of this file. Currently, use the special makefile!
#
# I could not test the settings below, lacking a well-behaved DOS make.exe:
# DOS/DJGPP + DJ previewer # Use dosdjgpp.mak !
#
# DEFINES = -DDOS -DGNU -DHAS_DOS_DJGR
# PREVIEWER = to_dj_gr
# ALL_LIBS = -lgr -lm
# BINDCMD = copy /b c:\djgpp\bin\stub.exe+$(PROGRAM) $(PROGRAM).exe
#
# DOS / Borland bcc # Use borland.mak !
#
# DEFINES = -DDOS -DHAS_DOS_VGA
# PREVIEWER = to_vga
# ALL_LIBS = -lm
#
# DOS / Borland bcc and Hercules previwer # Patch and use borland.mak !
#
# DEFINES = -DDOS -DHAS_DOS_HGC
# PREVIEWER = to_hgc
# ALL_LIBS = -lm
#
# ATARI ST/TT
#
# DEFINES = -DATARI # Use atari.mak !
# PREVIEWER = to_atari
# ALL_LIBS = -lm # Add whatever may be needed for Ataris
#
# AMIGA
#
# DEFINES = -DAMIGA # Use amiga.mak !
# PREVIEWER = to_amiga
# ALL_LIBS = -lm # Add whatever may be needed for Amigas
#
# VAX/VMS # Use VMS-MAKE.COM !
#
# DEFINES = -DVAX
# PREVIEWER = to_uis
# ALL_LIBS = -lm # Add whatever may be needed for VMS
#
#############################################################################
# Decide below if you want to include some extra modes:
# Recommendation: Add PIC & PAC only for ATARI
#
# Standard setting: No extras:
#
EX_SRC =
EX_OBJ =
EX_DEFS =
#
# Epson Esc/P2 support
#
#EX_SRC += to_escp2.c
#EX_OBJ += to_escp2.o
#EX_DEFS += -DEPSON
#
# Include PNG support:
EX_SRC += png.c to_png.c
EX_OBJ += png.o to_png.o
EX_DEFS += -DPNG
ALL_LIBS += -lpng
LFLAGS += -L/usr/local/lib
#
# Include TIFF support:
EX_SRC += to_tif.c
EX_OBJ += to_tif.o
EX_DEFS += -DTIF
ALL_LIBS += -ltiff -lz -ljpeg
#
# Include ATARI extras:
# EX_SRC += to_pic.c to_pac.c
# EX_OBJ += to_pic.o to_pac.o
# EX_DEFS += -DPIC_PAC
#
#############################################################################
# No user-serviceable parts below!
#############################################################################
COMMON_INCS = hp2xx.h bresnham.h murphy.h
ALL_INCS = $(COMMON_INCS) chardraw.h charset0.h charset5.h charset7.h \
getopt.h x11.h ilbm.h iff.h clip.h
ALL_CFLAGS = -c $(CFLAGS)
# $(SRCS) NOT USED YET:
SRCS = clip.c fillpoly.c\
hp2xx.c hpgl.c picbuf.c bresnham.c chardraw.c getopt.c getopt1.c \
$(ALL_INCS)\
to_vec.c to_pcx.c to_pcl.c to_eps.c to_img.c to_pbm.c \
to_rgip.c to_fig.c std_main.c $(PREVIEWER).c pendef.c lindef.c \
murphy.c $(EX_SRC)
OBJS = clip.o fillpoly.o\
hp2xx.o hpgl.o picbuf.o bresnham.o chardraw.o getopt.o getopt1.o \
to_vec.o to_pcx.o to_pcl.o to_eps.o to_img.o to_pbm.o \
to_rgip.o to_fig.o std_main.o $(PREVIEWER).o pendef.o lindef.o \
murphy.o $(EX_OBJ)
PROGRAM = hp2xx
$(PROGRAM): $(OBJS)
$(CC) $(LFLAGS) $(OBJS) $(ALL_LIBS) -o $(PROGRAM)
$(BINDCMD)
default:
@echo "This makefile needs manual configuration! Edit it now!"
@echo "After configuration, you may use the following commands:"
@echo ""
@echo "make all Compile everything"
@echo "make check Run a color application in preview mode"
@echo "make install-bin Install the binary file"
@echo "make install-man Install the manual page"
@echo "make install-info Create and install the info file"
@echo "make install Install everything"
@echo "make mostlyclean"
@echo "make clean"
@echo "make realclean"
#########################################################################
# #
# Implicit Rules #
# #
#########################################################################
# .c.o: $< $(COMMON_INCS)
# -$(RMCMD) $@
# $(CC) $(DEFINES) $(EX_DEFS) $(ALL_CFLAGS) $(CPPFLAGS) $<
#########################################################################
# #
# Explicit Rules #
# #
#########################################################################
hp2xx.info: ../doc/hp2xxinf.tex
$(CP) ../doc/hp2xxinf.tex hp2xx.texinfo
-$(MKINFO) hp2xx.texinfo
# bresnham.o: $< bresnham.h
# murphy.o: $< murphy.h
# chardraw.o: $< $(COMMON_INCS) chardraw.h charset0.h
# getopt.o: $< getopt.h
# getopt1.o: $< getopt.h
# hp2xx.o: $< $(COMMON_INCS) getopt.h
# hpgl.o: $< $(COMMON_INCS) chardraw.h
# ilbm.o: $< $(COMMON_INCS) ilbm.h iff.h
# to_x11.o: $< $(COMMON_INCS) x11.h
#########################################################################
check:
./$(PROGRAM) -m pre -c1234567 -h150 -w150 ../hp-tests/colors.hp
clean:
-make mostlyclean
-$(RMCMD) core a.out ./hp2xx.texinfo ./hp2xx.info $(PROGRAM)
distclean:
@echo make distclean -- not supported yet.
dist:
@echo make dist -- not supported yet.
mostlyclean:
-$(RMCMD) *.o
realclean:
-make clean
-$(RMCMD) $(PROGRAM)
TAGS:
@echo make TAGS -- not supported nor needed.
install: install-bin install-info install-man
install-bin: $(PROGRAM)
-$(STRIP) $(PROGRAM)
-$(CP) $(PROGRAM) $(bindir)
-$(CHMOD) 755 $(bindir)/$(PROGRAM)
install-info: hp2xx.info
-$(CP) hp2xx.info $(infodir)
-$(CHMOD) 644 $(infodir)/hp2xx.info
install-man: ../doc/hp2xx.1
-$(CP) ../doc/hp2xx.1 $(man1dir)
-$(CHMOD) 644 $(man1dir)/hp2xx.1