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
|
|
|
|
2001-01-15 02:28:46 +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
|
|
|
|
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-08 04:17:25 +00:00
|
|
|
SRCS = avr.c config.c fileio.c lists.c main.c pgm.c ppi.c stk500.c term.c
|
|
|
|
|
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
|
|
|
|
2003-02-08 04:17:25 +00:00
|
|
|
# these dependencies are manual
|
|
|
|
config_gram.o : config.h lists.h pindefs.h ppi.h pgm.h stk500.h avr.h
|
|
|
|
lexer.o : config.h y.tab.h lists.h
|
2001-11-21 02:46:55 +00:00
|
|
|
|
2003-02-08 04:17:25 +00:00
|
|
|
# these dependencie are generated using 'make depend'
|
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
|
2003-02-08 04:17:25 +00:00
|
|
|
config.o: config.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h \
|
|
|
|
y.tab.h
|
2003-02-06 05:13:32 +00:00
|
|
|
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 \
|
2003-02-08 04:17:25 +00:00
|
|
|
ppi.h term.h
|
2003-02-06 05:13:32 +00:00
|
|
|
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
|
2003-02-08 04:17:25 +00:00
|
|
|
stk500.o: stk500.c avr.h avrpart.h lists.h pgm.h pindefs.h \
|
|
|
|
stk500_private.h
|
2003-02-06 05:13:32 +00:00
|
|
|
term.o: term.c avr.h avrpart.h lists.h pgm.h pindefs.h config.h ppi.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
|
|
|
|
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-08 04:17:25 +00:00
|
|
|
depend :
|
|
|
|
@echo Dependency List:
|
|
|
|
@if [ ! -f y.tab.h ]; then touch y.tab.h; fi
|
2003-02-11 19:03:03 +00:00
|
|
|
@gcc ${CFLAGS} -MM ${SRCS}
|
2003-02-08 04:17:25 +00:00
|
|
|
|