blob: 4ef7b28ecb5b0b24ebe14c15e8369cfcb4cc0f24 [file] [log] [blame] [raw]
# $Id: gmakefile,v 1.17 2004/01/24 08:31:56 phil Exp - revised by DAG
# (GNU) Makefile for test programs under Unix/X11 and Win32
#
# Unix:
# edit Unix defs to fit your compiler/library environment, then
# gmake -f gmakefile
# or if GNU make is the default:
# make -f gmakefile
#
# Win32 (Cygwin)
# make WIN32=1
#
# Win32 (MINGW):
# mingw32-make -f gmakefile WIN32=1
DISP_DEFS=-DTEST_DIS=DIS_VR48 -DTEST_RES=RES_HALF # -DDEBUG_VT11
ifeq ($(WIN32),)
#Unix environments
X11BASE=/usr/X11R6
X11LIBDIR=$(X11BASE)/lib
X11INCDIR=$(X11BASE)/include
LIBS=-L$(X11LIBDIR) -lXt -lX11 -lm
OSFLAGS=-I$(X11INCDIR)
DRIVER=x11.o
EXT=
else
#Win32 environments
LIBS=-lgdi32
OSFLAGS=
DRIVER=win32.o
EXT=.exe
endif
#PROF=-g # -pg
OPT=-O2
CFLAGS=$(OPT) $(PROF) $(OSFLAGS) $(DISP_DEFS)
CC=gcc -Wunused
LDFLAGS=$(PROF)
ALL= munch$(EXT) vt11$(EXT)
ALL: $(ALL)
# munching squares; see README file for
# how to use console switches
MUNCH=$(DRIVER) display.o test.o
munch$(EXT): $(MUNCH)
$(CC) $(LDFLAGS) -o munch$(EXT) $(MUNCH) $(LIBS)
VT11=$(DRIVER) vt11.o vttest.o display.o
vt11$(EXT): $(VT11)
$(CC) $(LDFLAGS) -o vt11$(EXT) $(VT11) $(LIBS)
display.o: display.h ws.h
vt11.o: display.h vt11.h
x11.o: ws.h display.h
win32.o: ws.h
test.o: display.h vt11.h
vttest.o: display.h vt11.h vtmacs.h
clean:
ifeq ($(WIN32),)
rm -f *.o *~ .#*
else
if exist *.o del /q *.o
if exist *~ del /q *~
if exist .#* del /q .#*
endif
clobber: clean
ifeq ($(WIN32),)
rm -f $(ALL)
else
if exist *.exe del /q *.exe
endif