Makefile : install the man page
main.c : drop the giant usage text now that we have a man page. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@42 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
8e1a65399c
commit
880a2a8fdd
20
Makefile
20
Makefile
|
@ -8,6 +8,8 @@ TARGET = avrprog
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
BINDIR = ${PREFIX}/bin
|
BINDIR = ${PREFIX}/bin
|
||||||
|
MANDIR = ${PREFIX}/man/man1
|
||||||
|
MANUAL = avrprog.1
|
||||||
|
|
||||||
INSTALL = /usr/bin/install -c -o root -g wheel
|
INSTALL = /usr/bin/install -c -o root -g wheel
|
||||||
|
|
||||||
|
@ -23,10 +25,10 @@ INSTALL_MANUAL = ${INSTALL_DATA}
|
||||||
OBJS = avr.o fileio.o main.o ppi.o term.o
|
OBJS = avr.o fileio.o main.o ppi.o term.o
|
||||||
LIBS = -lreadline
|
LIBS = -lreadline
|
||||||
|
|
||||||
all : $(TARGET)
|
all : ${TARGET}
|
||||||
|
|
||||||
$(TARGET) : $(OBJS)
|
${TARGET} : ${OBJS}
|
||||||
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
|
${CC} ${LDFLAGS} -o ${TARGET} ${OBJS} ${LIBS}
|
||||||
|
|
||||||
main.o : avr.h fileio.h ppi.h term.h
|
main.o : avr.h fileio.h ppi.h term.h
|
||||||
avr.o : avr.h ppi.h
|
avr.o : avr.h ppi.h
|
||||||
|
@ -35,10 +37,14 @@ ppi.o : ppi.h
|
||||||
term.o : term.h avr.h
|
term.o : term.h avr.h
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *~ *.core $(TARGET) *.o
|
rm -f *~ *.core ${TARGET} *.o
|
||||||
|
|
||||||
install : ${BINDIR}/$(TARGET)
|
install : ${BINDIR}/${TARGET} ${MANDIR}/${MANUAL}.gz
|
||||||
|
|
||||||
${BINDIR}/$(TARGET) : $(TARGET)
|
${BINDIR}/${TARGET} : ${TARGET}
|
||||||
${INSTALL_PROGRAM} $(TARGET) ${BINDIR}
|
${INSTALL_PROGRAM} ${TARGET} ${BINDIR}
|
||||||
|
|
||||||
|
${MANDIR}/${MANUAL}.gz : ${MANUAL}
|
||||||
|
${INSTALL_MANUAL} ${MANUAL} ${MANDIR}
|
||||||
|
gzip ${MANDIR}/${MANUAL}
|
||||||
|
|
||||||
|
|
49
main.c
49
main.c
|
@ -76,55 +76,22 @@ char progbuf[PATH_MAX]; /* temporary buffer of spaces the same
|
||||||
length as progname; used for lining up
|
length as progname; used for lining up
|
||||||
multiline messages */
|
multiline messages */
|
||||||
|
|
||||||
char * usage_text =
|
|
||||||
"\n"
|
|
||||||
"Usage: avrprog [options]\n"
|
|
||||||
"\n"
|
|
||||||
" Available Options:\n"
|
|
||||||
"\n"
|
|
||||||
" -m MemType : select memory type for reading or writing\n"
|
|
||||||
" \"e\", \"eeprom\" = EEPROM\n"
|
|
||||||
" \"f\", \"flash\" = FLASH (default)\n"
|
|
||||||
"\n"
|
|
||||||
" -i Filename : select input file, \"-\" = stdin\n"
|
|
||||||
"\n"
|
|
||||||
" -o Filename : select output file, \"-\" = stdout\n"
|
|
||||||
"\n"
|
|
||||||
" -f Format : select input / output file format\n"
|
|
||||||
" \"i\" = Intel Hex\n"
|
|
||||||
" \"s\" = Motorola S-Record\n"
|
|
||||||
" \"r\" = Raw binary (default for output)\n"
|
|
||||||
" \"a\" = Auto detect (default for input)\n"
|
|
||||||
" (valid for input only)\n"
|
|
||||||
" \n"
|
|
||||||
"\n"
|
|
||||||
" -p Part : select Atmel part number (see below for valid parts)\n"
|
|
||||||
"\n"
|
|
||||||
" -P Parallel : select parallel port device name (default = /dev/ppi0)\n"
|
|
||||||
"\n"
|
|
||||||
" -F : override invalid device signature check\n"
|
|
||||||
"\n"
|
|
||||||
" -t : enter terminal mode (or read commands from stdin)\n"
|
|
||||||
"\n"
|
|
||||||
" -E exitspec[,...]: specify which bits to set/reset on exit\n"
|
|
||||||
" \"[no]reset\" = [don't] activate /RESET\n"
|
|
||||||
" \"[no]vcc\" = [don't] activate Vcc\n"
|
|
||||||
"\n"
|
|
||||||
" -e : perform a chip erase (required before programming)\n"
|
|
||||||
"\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* usage message
|
* usage message
|
||||||
*/
|
*/
|
||||||
void usage ( void )
|
void usage ( void )
|
||||||
{
|
{
|
||||||
fprintf ( stderr, "%s", usage_text );
|
fprintf(stderr,
|
||||||
|
"\nUsage: %s -p partno [-e] [-E exitspec[,exitspec]] [-f format] [-F]\n"
|
||||||
|
" %s[-i filename] [-m memtype] [-o filename] [-P parallel] [-t]\n\n",
|
||||||
|
progname, progbuf);
|
||||||
|
|
||||||
|
#if 0
|
||||||
fprintf(stderr, " Valid Parts for the -p option are:\n");
|
fprintf(stderr, " Valid Parts for the -p option are:\n");
|
||||||
avr_list_parts(stderr, " ");
|
avr_list_parts(stderr, " ");
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -223,7 +190,7 @@ int main ( int argc, char * argv [] )
|
||||||
* they are running
|
* they are running
|
||||||
*/
|
*/
|
||||||
fprintf(stderr, "\n%s: Copyright 2000 Brian Dean, bsd@bsdhome.com\n"
|
fprintf(stderr, "\n%s: Copyright 2000 Brian Dean, bsd@bsdhome.com\n"
|
||||||
"%sVersion %s\n", progname, progbuf, version);
|
"%sVersion %s\n\n", progname, progbuf, version);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* check for no arguments
|
* check for no arguments
|
||||||
|
|
Loading…
Reference in New Issue