These changes add basic support for a autoconf/automake based build system.

* .cvsignore: Ignore autoconf files.
	* AUTHORS: New file.
	* ChangeLog: New file.
	* Makefile: Removed file.
	* Makefile.am: New file.
	* NEWS: New file.
	* README: New file.
	* bootstrap: New file.
	* configure.ac: New file.
	* avr.c: Include ac_cfg.h (generated by autoconf).
	* config.c: Include ac_cfg.h.
	Include config_gram.h instead of y.tab.h.
	* config.h: If HAS_YYSTYPE is not defined, define YYSTYPE.
	* config_gram.y: Include ac_cfg.h.
	* fileio.c: Include ac_cfg.h.
	* lexer.l: Include config_gram.h instead of y.tab.h.
	* lists.c: Include ac_cfg.h.
	* main.c: Include ac_cfg.h.
	* par.c: Include ac_cfg.h.
	* pgm.c: Include ac_cfg.h.
	* ppi.c: Include ac_cfg.h.
	* stk500.c: Include ac_cfg.h.
	* term.c: Include ac_cfg.h.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@192 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
troth 2003-02-14 20:34:03 +00:00
parent c5d9b556ea
commit 1997cc5188
22 changed files with 162 additions and 118 deletions

View File

@ -6,3 +6,15 @@ lexer.c
config_gram.c config_gram.c
.cvsignore .cvsignore
.depend .depend
INSTALL
Makefile.in
ac_cfg.h.in
aclocal.m4
autom4te.cache
configure
depcomp
install-sh
missing
mkinstalldirs
stamp-h.in

0
AUTHORS Normal file
View File

0
ChangeLog Normal file
View File

115
Makefile
View File

@ -1,115 +0,0 @@
#
# avrdude - A Downloader/Uploader for AVR device programmers
# 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
#
#
# $Id$
#
TARGET = avrdude
PREFIX ?= /usr/local
BINDIR = ${PREFIX}/bin
MANDIR = ${PREFIX}/man/man1
MANUAL = avrdude.1
DOCDIR = ${PREFIX}/share/doc/avrdude
CONFIGDIR = ${PREFIX}/etc
DIRS = ${BINDIR} ${MANDIR} ${DOCDIR} ${CONFIGDIR}
INSTALL = /usr/bin/install -c -o root -g wheel
CFLAGS += -Wall -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
#CFLAGS = -g -Wall -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
LDFLAGS =
YFLAGS = -t -d -v
INSTALL_PROGRAM = ${INSTALL} -m 555 -s
INSTALL_DATA = ${INSTALL} -m 444
INSTALL_MANUAL = ${INSTALL_DATA}
LIBS = -lreadline
YYDEF = -DYYSTYPE="struct token_t *"
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
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
all : depend ${TARGET}
${TARGET} : ${OBJS}
${CC} ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
clean :
rm -f *.o config_gram.c lexer.c ${TARGET} *~ *.core y.tab.h y.output
install : dirs \
${BINDIR}/${TARGET} \
${MANDIR}/${MANUAL} \
${DOCDIR}/avrdude.pdf \
${CONFIGDIR}/avrdude.conf.sample \
${CONFIGDIR}/avrdude.conf
dirs :
@for dir in ${DIRS}; do \
if [ ! -d $$dir ]; then \
echo "creating directory $$dir"; \
mkdir -p $$dir; \
fi \
done
${BINDIR}/${TARGET} : ${TARGET}
${INSTALL_PROGRAM} ${TARGET} $@
${MANDIR}/${MANUAL} : ${MANUAL}
${INSTALL_MANUAL} ${MANUAL} $@
${DOCDIR}/avrdude.pdf : avrdude.pdf
${INSTALL_DATA} avrdude.pdf $@
${CONFIGDIR}/avrdude.conf.sample : avrdude.conf.sample
${INSTALL_DATA} avrdude.conf.sample $@
${CONFIGDIR}/avrdude.conf : avrdude.conf.sample
@if [ -f ${CONFIGDIR}/avrdude.conf ]; then \
export TS=`date '+%Y%m%d%H%M%S'`; \
echo "NOTE: backing up ${CONFIGDIR}/avrdude.conf to ${CONFIGDIR}/avrdude.conf.$${TS}"; \
cp -p ${CONFIGDIR}/avrdude.conf ${CONFIGDIR}/avrdude.conf.$${TS}; \
fi
${INSTALL_DATA} avrdude.conf.sample $@
.SUFFIXES: .c .y .l
.y.c:
${YACC} ${YFLAGS} -b y $<
mv -f y.tab.c $@
.l.c:
${LEX} -t $< > $@
depend :
@if [ ! -f y.tab.h ]; then touch y.tab.h; fi
@${MAKE} config_gram.c lexer.c
@${CC} ${CFLAGS} -MM ${SRCS} > .depend
include .depend

63
Makefile.am Normal file
View File

@ -0,0 +1,63 @@
#
# avrdude - A Downloader/Uploader for AVR device programmers
# Copyright (C) 2003 Theodore A. Roth <troth@openavr.org>
#
# 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
#
#
# $Id$
#
AM_YFLAGS = -d
AM_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\"
bin_PROGRAMS = avrdude
avrdude_SOURCES = \
config_gram.y \
lexer.l \
avr.c \
avr.h \
avrpart.h \
config.c \
config.h \
fileio.c \
fileio.h \
linux_ppdev.h \
lists.c \
lists.h \
main.c \
par.c \
par.h \
pgm.c \
pgm.h \
pindefs.h \
ppi.c \
ppi.h \
stk500.c \
stk500.h \
stk500_private.h \
term.c \
term.h
man_MANS = avrdude.1
sysconf_DATA = avrdude.conf
avrdude.conf: avrdude.conf.sample
cp $< $@

0
NEWS Normal file
View File

0
README Normal file
View File

2
avr.c
View File

@ -19,6 +19,8 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>

30
bootstrap Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# autoconf-2.57 is preferred, but >= 2.53 should be ok
if [ "x${AUTOHEADER}" = "x" ]; then
AUTOHEADER="autoheader-2.57"
fi
if [ "x${AUTOCONF}" = "x" ]; then
AUTOCONF="autoconf-2.57"
fi
# automake-1.7 is preferred, but >= 1.6 should be ok
if [ "x${ACLOCAL}" = "x" ]; then
ACLOCAL="aclocal-1.7"
fi
if [ "x${AUTOMAKE}" = "x" ]; then
AUTOMAKE="automake-1.7"
fi
# Bootstrap the build system.
set -x
${ACLOCAL}
${AUTOHEADER}
${AUTOCONF}
${AUTOMAKE} -a -c

View File

@ -19,6 +19,8 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -26,7 +28,7 @@
#include "avr.h" #include "avr.h"
#include "config.h" #include "config.h"
#include "y.tab.h" #include "config_gram.h"
char string_buf[MAX_STR_CONST]; char string_buf[MAX_STR_CONST];
char *string_buf_ptr; char *string_buf_ptr;

View File

@ -54,7 +54,7 @@ extern char * infile;
extern LISTID string_list; extern LISTID string_list;
extern LISTID number_list; extern LISTID number_list;
#if 0 #if !defined(HAS_YYSTYPE)
#define YYSTYPE struct token_t * #define YYSTYPE struct token_t *
#endif #endif
extern YYSTYPE yylval; extern YYSTYPE yylval;

View File

@ -20,6 +20,8 @@
/* $Id$ */ /* $Id$ */
%{ %{
#include "ac_cfg.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>

32
configure.ac Normal file
View File

@ -0,0 +1,32 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(avrdude, 3.1.0cvs, avrdude-dev@nongnu.org)
AC_PREREQ(2.53)
AC_CONFIG_SRCDIR([main.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([ac_cfg.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_YACC
AM_PROG_LEX
# Checks for libraries.
AC_CHECK_LIB([termcap], [tputs])
AC_CHECK_LIB([readline], [readline])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h sys/ioctl.h sys/time.h termios.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@ -19,6 +19,8 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <limits.h> #include <limits.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -29,7 +29,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "config.h" #include "config.h"
#include "y.tab.h" #include "config_gram.h"
#include "lists.h" #include "lists.h"
extern int lineno; extern int lineno;

View File

@ -36,6 +36,9 @@
Author : Brian Dean Author : Brian Dean
Date : 10 January, 1990 Date : 10 January, 1990
------------------------------------------------------------------------*/ ------------------------------------------------------------------------*/
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>

2
main.c
View File

@ -65,6 +65,8 @@
* *
*/ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>

2
par.c
View File

@ -19,6 +19,8 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

2
pgm.c
View File

@ -19,6 +19,8 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

2
ppi.c
View File

@ -21,6 +21,8 @@
#if defined(__FreeBSD__) || defined(__linux__) #if defined(__FreeBSD__) || defined(__linux__)
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -28,6 +28,8 @@
* *
*/ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

1
term.c
View File

@ -19,6 +19,7 @@
/* $Id$ */ /* $Id$ */
#include "ac_cfg.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>