#
# Makefile to make the X support library for the editor (libXedt.a)
# It is a subset of marcs widget set library libXms
#

# Name of this library
LIBID = Xedt
ARLIB = lib$(LIBID).a

# location of the necessary directories
TOP = $(HOME)/eag

# Destination of library when installing
LDIR = $(TOP)/lib

# Destination of header files when installing
IDIR = $(TOP)/include

# location of X11 include files
X11IDIR = /usr/local/X11R6/include

# Version number of the library
MAJORVERSION = 1
MINORVERSION = 2

# Choice of compiler
CC = gcc

DCFL = -O -Wall -ansi

CFLAGS = $(DCFL) -I$(IDIR) -I$(X11IDIR) -I.

SRCS =	XtArgs.c \
	Editor.c \
	ImmedLabel.c \
	XtSupp.c \
	XSupp.c \
	Primitive.c

HDRS =	XtArgs.h \
	XtSupp.h \
	XSupp.h \
	Editor.h \
	EditorP.h \
	ImmedLabel.h \
	ImmedLabelP.h \
	Primitive.h \
	PrimitiveP.h

OBJS =	XtArgs.o \
	Editor.o \
	ImmedLabel.o \
	XtSupp.o \
	XSupp.o \
	Primitive.o

DOC	=

MAKEFILE = Makefile

JUNK = tmp core makelog skeleton.log skeleton.aux skeleton.dvi

DISTFILES = $(SRCS) $(DOC) $(MAKEFILE) $(SKELFILES)

help :
	@echo	" Possible make targets:"
	@echo	"all		Create library."
	@echo	"clean		Free disk space."
	@echo	"distfiles	List distribution files."
	@echo	"install		Install relevant files."
	@echo	"instlib		Install only updated library."
	@echo	"test		Run tests."

all: $(ARLIB)

test:
	@echo	"sorry, no test programs for this library available"

install: instlib $(HDRS)
	cp $(HDRS) $(IDIR)

instlib: $(ARLIB)
	rm -f $(LDIR)/$(ARLIB)
	cp $(ARLIB) $(LDIR)
	ranlib $(LDIR)/$(ARLIB)

clean:
	rm -f $(JUNK) $(OBJS) $(ARLIB)

distfiles:
	@echo $(DISTFILES) | tr ' ' '\012'

# Non-standard make rules
###
$(ARLIB): $(OBJS)
	ar cru $(ARLIB) $(OBJS)
	ranlib $(ARLIB)

XtArgs.o: XtArgs.h
XtSupp.o: XtSupp.h
XSupp.o: XSupp.h
Primitive.o: Primitive.h PrimitiveP.h
Editor.o: Editor.h EditorP.h Primitive.h PrimitiveP.h
ImmedLabel.o: ImmedLabel.h ImmedLabelP.h Primitive.h PrimitiveP.h
