From b72cfc52f9354cb999b52f752143ee5474071d93 Mon Sep 17 00:00:00 2001 From: Serge Vakulenko Date: Mon, 1 Jun 2015 17:35:25 -0700 Subject: [PATCH] Kconfig compiled clean. --- tools/kconfig/Makefile | 25 +++++++++++++++---------- tools/kconfig/Makefile-bsd | 12 ++++++++++++ tools/kconfig/config.y | 2 -- tools/kconfig/lang.l | 3 +++ tools/kconfig/main.c | 11 ----------- tools/kconfig/mkglue.c | 13 ++++++------- tools/kconfig/mkheaders.c | 4 ---- tools/kconfig/mkioconf.c | 7 +------ tools/kconfig/mkmakefile.c | 13 ++++--------- tools/kconfig/mkswapconf.c | 4 ---- tools/kconfig/mkubglue.c | 4 ---- 11 files changed, 41 insertions(+), 57 deletions(-) create mode 100644 tools/kconfig/Makefile-bsd diff --git a/tools/kconfig/Makefile b/tools/kconfig/Makefile index fa710fa..96fe255 100644 --- a/tools/kconfig/Makefile +++ b/tools/kconfig/Makefile @@ -1,12 +1,17 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 +CC = gcc -g +CFLAGS = -O -Wall +YACC = byacc -d +DESTDIR = /usr/local +OBJS = config.o main.o lang.o mkioconf.o mkmakefile.o mkglue.o mkheaders.o \ + mkswapconf.o +PROG = kconfig -PROG= config -CFLAGS+=-I. -I${.CURDIR} -SRCS= config.c main.c lang.c mkioconf.c mkmakefile.c mkglue.c mkheaders.c \ - mkswapconf.c -MAN8= config.0 -DPADD= ${LIBL} -LDADD= -ll -CLEANFILES+=y.tab.h lang.c config.c y.tab.c config.0 +all: $(PROG) -.include +install: $(PROG) + install -s $(PROG) ${DESTDIR}/bin/$(PROG) +clean: + rm -rf *~ *.o *.lst *.dis $(PROG) $(PROG).dSYM y.tab.[ch] lang.c config.c + +$(PROG): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) diff --git a/tools/kconfig/Makefile-bsd b/tools/kconfig/Makefile-bsd new file mode 100644 index 0000000..fa710fa --- /dev/null +++ b/tools/kconfig/Makefile-bsd @@ -0,0 +1,12 @@ +# @(#)Makefile 8.1 (Berkeley) 6/6/93 + +PROG= config +CFLAGS+=-I. -I${.CURDIR} +SRCS= config.c main.c lang.c mkioconf.c mkmakefile.c mkglue.c mkheaders.c \ + mkswapconf.c +MAN8= config.0 +DPADD= ${LIBL} +LDADD= -ll +CLEANFILES+=y.tab.h lang.c config.c y.tab.c config.0 + +.include diff --git a/tools/kconfig/config.y b/tools/kconfig/config.y index 0998289..9093296 100644 --- a/tools/kconfig/config.y +++ b/tools/kconfig/config.y @@ -709,7 +709,6 @@ void mkswap(system, fl, size, flag) int size, flag; { register struct file_list **flp; - char name[80]; if (system == 0 || system->f_type != SYSTEMSPEC) { yyerror("\"swap\" spec precedes \"config\" specification"); @@ -765,7 +764,6 @@ void addcomp(compdev, fl) struct file_list *compdev, *fl; { register struct file_list **flp; - char name[80]; if (compdev == 0 || compdev->f_type != COMPDEVICE) { yyerror("component spec precedes device specification"); diff --git a/tools/kconfig/lang.l b/tools/kconfig/lang.l index 802dd9b..12431d1 100644 --- a/tools/kconfig/lang.l +++ b/tools/kconfig/lang.l @@ -1,3 +1,6 @@ +%option noinput +%option nounput +%option noyywrap %{ /*- * Copyright (c) 1980, 1993 diff --git a/tools/kconfig/main.c b/tools/kconfig/main.c index 8d04b76..82569b0 100644 --- a/tools/kconfig/main.c +++ b/tools/kconfig/main.c @@ -30,17 +30,6 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ - -#ifndef lint -static char copyright[] = -"@(#) Copyright (c) 1980, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - #include #include #include diff --git a/tools/kconfig/mkglue.c b/tools/kconfig/mkglue.c index a94c1cd..81ab74f 100644 --- a/tools/kconfig/mkglue.c +++ b/tools/kconfig/mkglue.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkglue.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - /* * Make the bus adaptor interrupt glue files. */ @@ -331,13 +327,16 @@ void vbglue() * HP9000/300 interrupts are auto-vectored. * Code is hardwired in locore.s */ -void hpglue() {} +void hpglue() +{ +} /* * Create the ISA interrupt vector glue file. */ -void vector() { - register FILE *fp, *gp; +void vector() +{ + register FILE *fp; register struct device *dp, *mp; int count; diff --git a/tools/kconfig/mkheaders.c b/tools/kconfig/mkheaders.c index 7c93587..b86a481 100644 --- a/tools/kconfig/mkheaders.c +++ b/tools/kconfig/mkheaders.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - /* * Make all the .h files for the optional entries */ diff --git a/tools/kconfig/mkioconf.c b/tools/kconfig/mkioconf.c index 313cf53..ef77297 100644 --- a/tools/kconfig/mkioconf.c +++ b/tools/kconfig/mkioconf.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkioconf.c 8.2 (Berkeley) 1/21/94"; -#endif /* not lint */ - #include #include "y.tab.h" #include "config.h" @@ -604,8 +600,7 @@ char *sirq(int); void i386_ioconf() { - register struct device *dp, *mp, *np; - register int uba_n, slave; + register struct device *dp, *mp; FILE *fp; fp = fopen(path("ioconf.c"), "w"); diff --git a/tools/kconfig/mkmakefile.c b/tools/kconfig/mkmakefile.c index 14307c4..dc3f6d4 100644 --- a/tools/kconfig/mkmakefile.c +++ b/tools/kconfig/mkmakefile.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - /* * Build the makefile for the system, from * the information in the files files and the @@ -157,7 +153,7 @@ void read_files() FILE *fp; register struct file_list *tp, *pf; register struct device *dp; - struct device *save_dp; + struct device *save_dp = 0; register struct opt *op; char *wd, *this, *needs, *special; char fname[32]; @@ -267,7 +263,8 @@ nextparam: dp->d_name = ns(wd); dp->d_type = PSEUDO_DEVICE; dp->d_slave = 1; - save_dp->d_next = dp; + if (save_dp) + save_dp->d_next = dp; goto nextparam; } for (op = opt; op != 0; op = op->op_next) @@ -297,7 +294,6 @@ doneparam: exit(1); } -save: if (wd) { printf("%s: syntax error describing %s\n", fname, this); @@ -406,7 +402,7 @@ void do_cfiles(fp) void do_rules(f) FILE *f; { - register char *cp, *np, och, *tp; + register char *cp, *np, och; register struct file_list *ftp; char *special; @@ -421,7 +417,6 @@ void do_rules(f) continue; } fprintf(f, "%so: $S/%s%c\n", tail(np), np, och); - tp = tail(np); special = ftp->f_special; if (special == 0) { char *ftype; diff --git a/tools/kconfig/mkswapconf.c b/tools/kconfig/mkswapconf.c index 2915654..89bb92d 100644 --- a/tools/kconfig/mkswapconf.c +++ b/tools/kconfig/mkswapconf.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkswapconf.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - /* * Build a swap configuration file. */ diff --git a/tools/kconfig/mkubglue.c b/tools/kconfig/mkubglue.c index 7d2b3d4..51ea8ae 100644 --- a/tools/kconfig/mkubglue.c +++ b/tools/kconfig/mkubglue.c @@ -31,10 +31,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)mkubglue.c 8.1 (Berkeley) 6/6/93"; -#endif /* not lint */ - /* * Make the uba interrupt file ubglue.s */