
# @(#) Makefile 5.1 89/02/20

# Makefile for UNIX, Xenix, and MS-DOS compiled under Xenix.
#
# Edit the config.h file for your system before running make.
# Uncomment the CFLAGS, LIBS and EXE_SUFFIX defines (below) for your 
# system, by removing the "# " in front of the lines that apply to your
# system.
#
# Run "make" to build the GL library and demo programs.
# Follow instructions in the INSTALL file before running demos.

# ===> BEGINNING OF USER CONFIGURATIONS <===

# Compiler flags:
#
# For Microport 286, use:
CFLAGS = -Ml -O 
# For Xenix 286, use:
# (Warning:  uSoft optimizer may mess you up; don't use it...)
# CFLAGS = -Ml -Me
# For Xenix 286 cross compile to MS-DOS target, use:
# CFLAGS = -Ml -Me -dos

# Link library flags:
#
# For UNIX, use the math library:
LIBS = -lm
# For MS-DOS target, no math library needed:
# LIBS = 

# Suffix to stick on the end of the executable program:
#
# For UNIX, no suffix:
EXE_SUFFIX=
# For MS-DOS target, executables are called *.EXE:
# EXE_SUFFIX=.exe

# ===> END OF USER CONFIGURATIONS <===

HDR = bitmaps.h cellfont.h config.h font.h graphics.h modes.h gl.h gf_types.h

OBJ = g_clear.o n_mvpen.o n_draw.o n_box.o n_line.o p_wr_pix.o g_init.o n_gfchar.o n_gfstr.o g_finish.o c_cellch.o c_cellst.o c_cursor.o g_pixctl.o n_curves.o n_point.o plot.o g_fntctl.o xform.o trig.o machdep.o g_print.o

# Default make operations, for Microport System V/AT
uport:	gl.a demo xdemo modeprog 

# Make operations for Xenix 286
xenix:	gl.a demo xdemo 

# Make operations for Xenix cross compile to MS-DOS target
dos:	gl.a demo xdemo 

clean:
	rm $(OBJ)
	rm mode.o setmode.o
	rm demo.o testpat.o xdemo.o

clobber:
	rm modeprog demo xdemo gl.a
	rm $(OBJ)
	rm mode.o setmode.o
	rm demo.o testpat.o xdemo.o

modeprog:	mode.c setmode.c 
	cc -o modeprog$(EXE_SUFFIX) mode.c setmode.c
	chmod +x mode.sh
	#
	# If you have an EGA or CGA, you can use mode.sh instead of
	# the mode.c program (mv mode.sh mode)."  If you have an Everex
	# Edge, use mode.c (mv modeprog mode).  For other adapters, you 
	# may have to modify mode.c.  A slightly modified version of
	# mode.c may be required for standard hercules graphics.
	#
	# For Xenix 286, use mode.xenix (edit to taste).
	#
	# If you use mode.c, you must make the executable (mode) suid and 
	# owned by root.  Put it in a safe path, of course.
	# For example, sign as root, then:
	#
	#   $ mv modeprog /usr/bin/mode
	#   $ chmod 4555 /usr/bin/mode
	#
	# Don't forget to create your video shared memory using shmcreate(1)
	# (Microport only).  This should be in your /etc/rc.d/shm.rc file.
	#
	# Try running demo and xdemo to see how things work.

gl.a:	$(OBJ) $(HDR)
	ar rv gl.a $(OBJ)
	sh -c "if test -x /usr/bin/ranlib -o -x /bin/ranlib;then ranlib gl.a;fi"

demo:	demo.o testpat.o gl.a
	cc -o demo$(EXE_SUFFIX) $(CFLAGS) demo.o testpat.o gl.a $(LIBS)

xdemo:	xdemo.o gl.a
	cc -o xdemo$(EXE_SUFFIX) $(CFLAGS) xdemo.o gl.a $(LIBS)

