#
# Makefile for ../abckeys.
#
# This is intended to be used through ../Makefile, where several
# generic macro's are filled in.
# The following macro's are more specific and should be changed here
# in case you have to make very drastic changes.

# --- Include flags to the C compiler ---

KINCL=	-I../bhdrs -I../ehdrs -I../uhdrs

# --- Include flags for lint ---

LKINCL=		$(KINCL)

# --- Relevant files ---

OBJS=	keydef.o keyhlp.o \
	e1getc.o \
	b1file.o b1memo.o b1mess.o getopt.o b1outp.o \
	u1file.o u1keys.o u1trm.o u1dir.o

SRCS=	keydef.c keyhlp.c \
	../bed/e1getc.c \
	../b/b1file.c ../b/b1memo.c ../b/b1mess.c ../b/getopt.c ../b/b1outp.c \
	../unix/u1file.c ../unix/u1keys.c ../unix/u1trm.c ../unix/u1dir.c

HDRS=	keydef.h \
	../bhdrs/b.h ../bhdrs/bfil.h ../bhdrs/bmem.h \
	../bhdrs/bobj.h ../bhdrs/getopt.h \
	../ehdrs/getc.h ../ehdrs/keys.h ../ehdrs/trm.h \
	../uhdrs/osgen.h ../uhdrs/feat.h ../uhdrs/defs.h

# --- Main entries of the makefile ---

all:	../abckeys

../abckeys: $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o ../abckeys

keydef.o: keydef.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) keydef.c

keyhlp.o: keyhlp.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) keyhlp.c

e1getc.o: ../bed/e1getc.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../bed/e1getc.c

getopt.o: ../b/getopt.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/getopt.c

b1file.o: ../b/b1file.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1file.c

b1memo.o: ../b/b1memo.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1memo.c

b1mess.o: ../b/b1mess.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1mess.c

b1outp.o: ../b/b1outp.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../b/b1outp.c

u1file.o: ../unix/u1file.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1file.c

u1keys.o: ../unix/u1keys.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1keys.c

u1trm.o: ../unix/u1trm.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1trm.c

u1dir.o: ../unix/u1dir.c
	$(CC) -c $(CFLAGS) -DKEYS $(KINCL) ../unix/u1dir.c

# --- Utilities for the programmer ---

depend:
	@$(MKDEP) $(DEFS) $(KINCL) $(SRCS)

lint:
	$(LINT) $(LINTFLAGS) $(DEFS) -DKEYS $(LKINCL) $(SRCS)

ALWAYS:	#dummy

###
# Dependency information is taken from ./Dep or ./DEP; see ../Makefile.
###
