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
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
TARGET = avrdude
|
2001-01-15 02:28:46 +00:00
|
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
|
BINDIR = ${PREFIX}/bin
|
2001-01-20 04:28:49 +00:00
|
|
|
MANDIR = ${PREFIX}/man/man1
|
2003-02-06 05:13:32 +00:00
|
|
|
MANUAL = avrdude.1
|
|
|
|
DOCDIR = ${PREFIX}/share/doc/avrdude
|
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
|
|
|
|
2002-10-12 21:22:57 +00:00
|
|
|
CFLAGS += -Wall -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
|
2002-11-30 14:09:12 +00:00
|
|
|
#CFLAGS = -g -Wall -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 *"
|
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
OBJS = config_gram.o avr.o config.o fileio.o lexer.o lists.o main.o pgm.o \
|
|
|
|
ppi.o stk500.o term.o
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
all : ${TARGET}
|
2001-02-25 17:39:58 +00:00
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
${TARGET} : ${OBJS}
|
|
|
|
${CC} ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2000-08-05 05:12:50 +00:00
|
|
|
clean :
|
2003-02-06 05:13:32 +00:00
|
|
|
rm -f *.o lexer.c ${TARGET} *~ *.core y.tab.c y.tab.h y.output
|
2000-08-05 05:12:50 +00:00
|
|
|
|
2001-10-15 00:28:23 +00:00
|
|
|
install : dirs \
|
|
|
|
${BINDIR}/${TARGET} \
|
|
|
|
${MANDIR}/${MANUAL} \
|
2003-02-06 05:13:32 +00:00
|
|
|
${DOCDIR}/avrdude.pdf \
|
|
|
|
${CONFIGDIR}/avrdude.conf.sample \
|
|
|
|
${CONFIGDIR}/avrdude.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
|
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
avr.o: avr.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h ppi.h
|
|
|
|
|
|
|
|
config.o: config.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h
|
|
|
|
|
|
|
|
fileio.o: fileio.c avr.h avrpart.h lists.h pgm.h pindefs.h fileio.h
|
|
|
|
|
|
|
|
lists.o: lists.c lists.h
|
|
|
|
|
|
|
|
main.o: main.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h fileio.h \
|
|
|
|
ppi.h term.h
|
|
|
|
|
|
|
|
pgm.o: pgm.c pgm.h avrpart.h lists.h pindefs.h
|
|
|
|
|
|
|
|
ppi.o: ppi.c avr.h avrpart.h lists.h pgm.h pindefs.h ppi.h config.h
|
|
|
|
|
|
|
|
stk500.o: stk500.c avr.h avrpart.h lists.h pgm.h pindefs.h stk500_private.h
|
|
|
|
|
|
|
|
term.o: term.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h ppi.h
|
|
|
|
|
2001-11-21 02:46:55 +00:00
|
|
|
|
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
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
${DOCDIR}/avrdude.pdf : avrdude.pdf
|
|
|
|
${INSTALL_DATA} avrdude.pdf $@
|
2001-09-19 17:04:25 +00:00
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
${CONFIGDIR}/avrdude.conf.sample : avrdude.conf.sample
|
|
|
|
${INSTALL_DATA} avrdude.conf.sample $@
|
2001-04-25 22:35:14 +00:00
|
|
|
|
2003-02-06 05:13:32 +00:00
|
|
|
${CONFIGDIR}/avrdude.conf : avrdude.conf.sample
|
|
|
|
@if [ -f ${CONFIGDIR}/avrdude.conf ]; then \
|
2002-04-07 16:03:58 +00:00
|
|
|
export TS=`date '+%Y%m%d%H%M%S'`; \
|
2003-02-06 05:13:32 +00:00
|
|
|
echo "NOTE: backing up ${CONFIGDIR}/avrdude.conf to ${CONFIGDIR}/avrdude.conf.$${TS}"; \
|
|
|
|
cp -p ${CONFIGDIR}/avrdude.conf ${CONFIGDIR}/avrdude.conf.$${TS}; \
|
2001-10-15 00:11:56 +00:00
|
|
|
fi
|
2003-02-06 05:13:32 +00:00
|
|
|
${INSTALL_DATA} avrdude.conf.sample $@
|
2001-10-15 00:11:56 +00:00
|
|
|
|