2003-02-06 19:54:46 +00:00
|
|
|
#
|
2003-02-08 04:17:25 +00:00
|
|
|
# avrdude - A Downloader/Uploader for AVR device programmers
|
2003-02-06 19:54:46 +00:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean <bsd@bsdhome.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
2000-08-05 05:12:50 +00:00
|
|
|
#
|
|
|
|
# $Id$
|
|
|
|
#
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2003-02-08 04:17:25 +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
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
LIBS = -lreadline
|
|
|
|
|
|
|
|
YYDEF = -DYYSTYPE="struct token_t *"
|
|
|
|
|
2003-02-13 19:27:50 +00:00
|
|
|
SRCS = config_gram.c avr.c config.c fileio.c lexer.c lists.c main.c par.c \
|
|
|
|
pgm.c ppi.c stk500.c term.c
|
2003-02-08 04:17:25 +00:00
|
|
|
|
2003-02-13 19:27:50 +00:00
|
|
|
OBJS = config_gram.o avr.o config.o fileio.o lexer.o lists.o main.o par.o \
|
|
|
|
pgm.o ppi.o stk500.o term.o
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2003-02-11 21:01:02 +00:00
|
|
|
all : depend ${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-11 21:01:02 +00:00
|
|
|
rm -f *.o config_gram.c lexer.c ${TARGET} *~ *.core 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
|
|
|
|
|
|
|
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
|
|
|
|
2003-02-11 21:01:02 +00:00
|
|
|
.SUFFIXES: .c .y .l
|
|
|
|
|
|
|
|
.y.c:
|
2003-02-12 17:24:43 +00:00
|
|
|
${YACC} ${YFLAGS} -b y $<
|
2003-02-11 21:01:02 +00:00
|
|
|
mv -f y.tab.c $@
|
|
|
|
|
|
|
|
.l.c:
|
|
|
|
${LEX} -t $< > $@
|
|
|
|
|
2003-02-08 04:17:25 +00:00
|
|
|
depend :
|
|
|
|
@if [ ! -f y.tab.h ]; then touch y.tab.h; fi
|
2003-02-11 21:01:02 +00:00
|
|
|
@${MAKE} config_gram.c lexer.c
|
|
|
|
@${CC} ${CFLAGS} -MM ${SRCS} > .depend
|
|
|
|
|
2003-02-12 17:24:43 +00:00
|
|
|
include .depend
|
2003-02-08 04:17:25 +00:00
|
|
|
|