# makefile for ICBM3D v.0.4

# by Bill Kendrick
# nbs@sonic.net
# http://www.sonic.net/~nbs/unix/x/icbm3d/

# February 28, 1998 - July 29, 1998


# Makefile user-definable variables------------------------------------------

CC=gcc
MATHLIB=-lm

INSTALLROOT=$(PREFIX)
LANGUAGE=english

XLIB=-L$(PREFIX)/lib -lX11 #-lcompat
CFLAGS=-I$(PREFIX)/include -O2


# End of makefile user-definable variables-----------------------------------



# Makefile commands:

all:	icbm3d
	chmod 644 *.c *.h makefile *.txt
	@echo "Moving 'icbm3d' to $(INSTALLROOT)"
	- cp icbm3d $(INSTALLROOT)/icbm3d

clean:
	- rm *.o icbm3d language.h


OBJECTS=icbm3d.o window.o connect.o hints.o visual.o gc.o color.o randnum.o \
	text.o

# Applications:

icbm3d:	$(OBJECTS)
	$(CC) $(OBJECTS) $(XLIB) $(MATHLIB) $(CFLAGS) -o icbm3d
	chmod 755 icbm3d


#dependencies

icbm3d.o:	icbm3d.c window.h connect.h hints.h visual.h gc.h color.h \
		randnum.h text.h keydefs.h language.h
	$(CC) $(CFLAGS) icbm3d.c -c


# Library objects:

window.o:	window.c window.h

connect.o:	connect.c connect.h

hints.o:	hints.c hints.h

visual.o:	visual.c visual.h

gc.o:		gc.c gc.h

color.o:	color.c color.h

randnum.o:	randnum.c randnum.h

text.o:		text.c text.h

language.h:	lang_$(LANGUAGE).h
	@echo "Using $(LANGUAGE) for messages..."
	- rm language.h
	@echo "/* *** DO NOT EDIT THIS FILE! *** */" > language.h
	@echo "/* Instead, edit: lang_$(LANGUAGE).h and rebuild with: */" \
		>> language.h
	@echo "/* 'make clean ; make ... LANGUAGE=$(LANGUAGE) ...' */" \
		>> language.h
	@echo >> language.h
	cat lang_$(LANGUAGE).h >> language.h
