#
# cardmgr/Makefile v1.23: 1995/03/23 05:01:39 (David Hinds)
#

# Include site dependent options
include ../make.options
include ../xtra.options

ifndef CFLAGS
CFLAGS = -O -Wall -Wstrict-prototypes -pipe -I../modules
XFLAGS = -O -pipe -I../modules
endif

SRCS = cardmgr.c cardctl.c yacc_config.c lex_config.c probe.c

COFLAGS = -kv
YFLAGS = -d

TOOLS = cardmgr cardctl

ifdef HAS_FORMS
TOOLS := ${TOOLS} cardinfo
endif

all:	$(TOOLS) probe

dep:	$(SRCS)
	$(CPP) -M -I../modules $(SRCS) > .depend

clean:
	rm -f core core.* *.o *.a tmp_make *~
	for i in *.c;do rm -f `basename $$i .c`.s;done
	rm -f lex_config.c yacc_config.c y.tab.*
	rm -f $(TOOLS) probe

cardmgr: cardmgr.o yacc_config.o lex_config.o

cardmgr.o: cardmgr.c
	$(CC) $(CFLAGS) -DETC=\"$(ETC)\" -c cardmgr.c

yacc_config.o: yacc_config.c
	$(CC) $(XFLAGS) -c yacc_config.c

lex_config.o: lex_config.c
	$(CC) $(XFLAGS) -c lex_config.c

parser: lex_config.o yacc_config.c
	$(CC) $(CFLAGS) -DDEBUG -o parser yacc_config.c lex_config.o

cardinfo: cardinfo.o
	$(CC) $(LFLAGS) -o cardinfo cardinfo.o -lforms -lX11 -lm
	chmod u+s cardinfo

install: $(TOOLS)
	cp -f cardmgr cardctl /sbin
	if [ -r cardinfo ] ; then cp -f cardinfo /usr/bin/X11 ; fi

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif




