
#
#	RasMol makefile for NEXTSTEP systems.
#		(c) 1995 Andreas Windemuth
#
#  "make" builds the rasmol library for linking to RasMol.app
#  "make test" builds and runs a command line version with no graphics

.SUFFIXES: .m .c .o


CC = cc
OPT=-g -O
#ARCH=-arch m68k -arch i486
CMOD=-DAPP
CFLAGS=$(ARCH) $(OPT) -I. -DNEXT $(CMOD)

DEPTHDEF = -DEIGHTBIT
RASMOLDIR = /usr/local/lib/rasmol/
DEFINES = -DRASMOLDIR=\"$(RASMOLDIR)\" $(DEPTHDEF)


MAIN=rasmol

CFILES = $(MAIN).c molecule.c abstree.c command.c \
    transfor.c render.c pixutils.c outfile.c script.c infile.c repres.c

MFILES = rasnext.m

OFILES =$(MFILES:.m=.o) $(CFILES:.c=.o)

LIBS=-lNeXT_s

librasmol.a lib: $(OFILES)
#	ar rc librasmol.a $(OFILES)
#	ranlib librasmol.a
	libtool -o librasmol.a $(OFILES)

test:
	make CMOD="" rasmol
	rasmol data/1crn.pdb

rasmol: $(OFILES)
	$(CC) $(CFLAGS) -o rasmol $(OFILES) $(LIBS)

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

.m.o:
	$(CC) $(CFLAGS) -c $*.m

SOURCES=makefile makefile.next make.depend *.h $(MFILES) $(CFILES)

tar:
	(cd ..; tar cvf - `cd rasmol; make tarlist`) | gzip > rasmol.tar.gz

tarlist:
	@ls $(SOURCES) | sed 's|^\(.*\)$$|rasmol/\1|'
	@cd rasnext; make tarlist | sed 's|^\(.*\)$$|rasmol/\1|'

clean:
	rm -f *.o rasmol_test librasmol.a

depend:
	$(CC) -MM $(MFILES) $(CFILES) > make.depend

include make.depend

DEPTHDEF = -DEIGHTBIT
RASMOLDIR = /usr/local/lib/rasmol/
DEFINES = -DRASMOLDIR=\"$(RASMOLDIR)\" $(DEPTHDEF)

SRCS = rasmol.c rasmol.h molecule.c molecule.h abstree.c abstree.h \
       command.c command.h tokens.h transfor.c transfor.h render.c render.h \
       x11win.c graphics.h pixutils.c pixutils.h font.h outfile.c outfile.h \
       script.c script.h

OBJS = rasmol.o molecule.o abstree.o command.o transfor.o render.o x11win.o \
       pixutils.o outfile.o script.o

