2001-01-15 02:28:46 +00:00
|
|
|
#------------------------------------------------------------------------
|
2000-08-05 05:12:50 +00:00
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-01-15 02:28:46 +00:00
|
|
|
|
|
|
|
TARGET = avrprog
|
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = ${PREFIX}/bin
|
2001-01-20 04:28:49 +00:00
|
|
|
MANDIR = ${PREFIX}/man/man1
|
|
|
|
MANUAL = avrprog.1
|
2001-04-25 22:35:14 +00:00
|
|
|
DOCDIR = ${PREFIX}/share/doc/avrprog
|
2001-09-19 17:04:25 +00:00
|
|
|
CONFIGDIR = ${PREFIX}/etc
|
2001-04-25 22:35:14 +00:00
|
|
|
|
2001-09-19 17:04:25 +00:00
|
|
|
DIRS = ${BINDIR} ${MANDIR} ${DOCDIR} ${CONFIGDIR}
|
2001-01-15 02:28:46 +00:00
|
|
|
|
|
|
|
INSTALL = /usr/bin/install -c -o root -g wheel
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-10-15 00:00:09 +00:00
|
|
|
CFLAGS += -g -Wall --pedantic -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
|
2001-01-19 02:46:50 +00:00
|
|
|
LDFLAGS =
|
2001-10-14 23:17:26 +00:00
|
|
|
YFLAGS = -t -d -v
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-01-15 02:28:46 +00:00
|
|
|
INSTALL_PROGRAM = ${INSTALL} -m 555 -s
|
|
|
|
INSTALL_DATA = ${INSTALL} -m 444
|
|
|
|
INSTALL_MANUAL = ${INSTALL_DATA}
|
2000-08-06 03:53:06 +00:00
|
|
|
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
LIBS = -lreadline
|
|
|
|
|
|
|
|
YYDEF = -DYYSTYPE="struct token_t *"
|
|
|
|
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-02-25 17:39:58 +00:00
|
|
|
.include "Makefile.inc"
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
EXTRA_OBJS = config_gram.o lexer.o
|
|
|
|
OBJECTS = ${EXTRA_OBJS} ${OBJS}
|
|
|
|
|
2001-02-25 17:39:58 +00:00
|
|
|
all :
|
2001-10-14 23:17:26 +00:00
|
|
|
@if [ ! -f y.tab.h ]; then touch y.tab.h; fi
|
2001-02-25 17:39:58 +00:00
|
|
|
make depend
|
|
|
|
make ${TARGET}
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
${TARGET} : ${OBJECTS}
|
|
|
|
${CC} ${LDFLAGS} -o ${TARGET} ${OBJECTS} ${LIBS}
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2000-08-05 05:12:50 +00:00
|
|
|
clean :
|
2001-10-14 23:17:26 +00:00
|
|
|
rm -f *.o lexer.c ${TARGET} *~ *.core y.tab.c y.tab.h
|
|
|
|
touch y.tab.h
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-10-15 00:28:23 +00:00
|
|
|
install : dirs \
|
|
|
|
${BINDIR}/${TARGET} \
|
|
|
|
${MANDIR}/${MANUAL} \
|
|
|
|
${DOCDIR}/avrprog.pdf \
|
|
|
|
${CONFIGDIR}/avrprog.conf.sample \
|
|
|
|
${CONFIGDIR}/avrprog.conf
|
2001-04-25 22:35:14 +00:00
|
|
|
|
2001-11-21 02:46:55 +00:00
|
|
|
config_gram.o : avr.h config.h lists.h pindefs.h
|
|
|
|
|
|
|
|
|
2001-04-25 22:35:14 +00:00
|
|
|
dirs :
|
|
|
|
@for dir in ${DIRS}; do \
|
|
|
|
if [ ! -d $$dir ]; then \
|
|
|
|
echo "creating directory $$dir"; \
|
|
|
|
mkdir -p $$dir; \
|
|
|
|
fi \
|
|
|
|
done
|
2000-08-06 03:53:06 +00:00
|
|
|
|
2001-01-20 04:28:49 +00:00
|
|
|
${BINDIR}/${TARGET} : ${TARGET}
|
2001-09-19 17:04:25 +00:00
|
|
|
${INSTALL_PROGRAM} ${TARGET} $@
|
2001-01-20 04:28:49 +00:00
|
|
|
|
2001-01-22 14:32:23 +00:00
|
|
|
${MANDIR}/${MANUAL} : ${MANUAL}
|
2001-09-19 17:04:25 +00:00
|
|
|
${INSTALL_MANUAL} ${MANUAL} $@
|
2000-08-06 03:53:06 +00:00
|
|
|
|
2001-09-19 17:04:25 +00:00
|
|
|
${DOCDIR}/avrprog.pdf : avrprog.pdf
|
|
|
|
${INSTALL_DATA} avrprog.pdf $@
|
|
|
|
|
|
|
|
${CONFIGDIR}/avrprog.conf.sample : avrprog.conf.sample
|
|
|
|
${INSTALL_DATA} avrprog.conf.sample $@
|
2001-04-25 22:35:14 +00:00
|
|
|
|
2001-10-15 00:11:56 +00:00
|
|
|
${CONFIGDIR}/avrprog.conf : avrprog.conf.sample
|
|
|
|
@if [ -f ${CONFIGDIR}/avrprog.conf ]; then \
|
2001-10-15 00:28:23 +00:00
|
|
|
echo "WARNING: backing up ${CONFIGDIR}/avrprog.conf to ${CONFIGDIR}/avrprog.conf.old"; \
|
2001-10-15 00:11:56 +00:00
|
|
|
cp -p ${CONFIGDIR}/avrprog.conf ${CONFIGDIR}/avrprog.conf.old; \
|
|
|
|
fi
|
|
|
|
${INSTALL_DATA} avrprog.conf.sample $@
|
|
|
|
|