Generate dependencies specific to the target system.
Explicitly use byacc. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@181 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
0a043de4ba
commit
e018acd263
47
Makefile
47
Makefile
|
@ -21,7 +21,6 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
TARGET = avrdude
|
TARGET = avrdude
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
|
@ -33,6 +32,7 @@ CONFIGDIR = ${PREFIX}/etc
|
||||||
|
|
||||||
DIRS = ${BINDIR} ${MANDIR} ${DOCDIR} ${CONFIGDIR}
|
DIRS = ${BINDIR} ${MANDIR} ${DOCDIR} ${CONFIGDIR}
|
||||||
|
|
||||||
|
YACC = byacc
|
||||||
INSTALL = /usr/bin/install -c -o root -g wheel
|
INSTALL = /usr/bin/install -c -o root -g wheel
|
||||||
|
|
||||||
CFLAGS += -Wall -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
|
CFLAGS += -Wall -DCONFIG_DIR=\"${CONFIGDIR}\" ${YYDEF}
|
||||||
|
@ -44,24 +44,24 @@ INSTALL_PROGRAM = ${INSTALL} -m 555 -s
|
||||||
INSTALL_DATA = ${INSTALL} -m 444
|
INSTALL_DATA = ${INSTALL} -m 444
|
||||||
INSTALL_MANUAL = ${INSTALL_DATA}
|
INSTALL_MANUAL = ${INSTALL_DATA}
|
||||||
|
|
||||||
|
|
||||||
LIBS = -lreadline
|
LIBS = -lreadline
|
||||||
|
|
||||||
YYDEF = -DYYSTYPE="struct token_t *"
|
YYDEF = -DYYSTYPE="struct token_t *"
|
||||||
|
|
||||||
SRCS = avr.c config.c fileio.c lists.c main.c pgm.c ppi.c stk500.c term.c
|
SRCS = config_gram.c avr.c config.c fileio.c lexer.c lists.c main.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 pgm.o \
|
OBJS = config_gram.o avr.o config.o fileio.o lexer.o lists.o main.o pgm.o \
|
||||||
ppi.o stk500.o term.o
|
ppi.o stk500.o term.o
|
||||||
|
|
||||||
all : ${TARGET}
|
all : depend ${TARGET}
|
||||||
|
|
||||||
|
|
||||||
${TARGET} : ${OBJS}
|
${TARGET} : ${OBJS}
|
||||||
${CC} ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
|
${CC} ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *.o lexer.c ${TARGET} *~ *.core y.tab.c y.tab.h y.output
|
rm -f *.o config_gram.c lexer.c ${TARGET} *~ *.core y.tab.h y.output
|
||||||
|
|
||||||
install : dirs \
|
install : dirs \
|
||||||
${BINDIR}/${TARGET} \
|
${BINDIR}/${TARGET} \
|
||||||
|
@ -70,24 +70,6 @@ install : dirs \
|
||||||
${CONFIGDIR}/avrdude.conf.sample \
|
${CONFIGDIR}/avrdude.conf.sample \
|
||||||
${CONFIGDIR}/avrdude.conf
|
${CONFIGDIR}/avrdude.conf
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# these dependencie are generated using 'make depend'
|
|
||||||
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 \
|
|
||||||
y.tab.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
|
|
||||||
|
|
||||||
dirs :
|
dirs :
|
||||||
@for dir in ${DIRS}; do \
|
@for dir in ${DIRS}; do \
|
||||||
if [ ! -d $$dir ]; then \
|
if [ ! -d $$dir ]; then \
|
||||||
|
@ -116,8 +98,19 @@ ${CONFIGDIR}/avrdude.conf : avrdude.conf.sample
|
||||||
fi
|
fi
|
||||||
${INSTALL_DATA} avrdude.conf.sample $@
|
${INSTALL_DATA} avrdude.conf.sample $@
|
||||||
|
|
||||||
depend :
|
.SUFFIXES: .c .y .l
|
||||||
@echo Dependency List:
|
|
||||||
@if [ ! -f y.tab.h ]; then touch y.tab.h; fi
|
.y.c:
|
||||||
@gcc ${CFLAGS} -MM ${SRCS}
|
${YACC} ${YFLAGS} $<
|
||||||
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue