Move CLI portion of nvramtool into cli/ subdirectory as first step towards librarization.

Also: update one regex wrapper user.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Stefan Reinauer <stefan.reinauer@coreboot.org>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6310 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Patrick Georgi 2011-01-28 07:47:10 +00:00 committed by Patrick Georgi
parent c7ca3e5ca4
commit c6d2b09f76
5 changed files with 10 additions and 7 deletions

View File

@ -24,12 +24,16 @@ CC = gcc
STRIP = strip STRIP = strip
INSTALL = /usr/bin/install INSTALL = /usr/bin/install
PREFIX = /usr/local PREFIX = /usr/local
CFLAGS = -O2 -g -Wall -W CFLAGS = -O2 -g -Wall -W -I.
#CFLAGS = -Os -Wall #CFLAGS = -Os -Wall
CLI_OBJS = cli/nvramtool.o cli/opts.o
OBJS = cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \ OBJS = cmos_lowlevel.o cmos_ops.o common.o compute_ip_checksum.o \
hexdump.o input_file.o layout.o layout_file.o lbtable.o \ hexdump.o input_file.o layout.o layout_file.o lbtable.o \
nvramtool.o opts.o reg_expr.o cbfs.o reg_expr.o cbfs.o
OBJS += $(CLI_OBJS)
OS_ARCH = $(shell uname) OS_ARCH = $(shell uname)
ifeq ($(OS_ARCH), Darwin) ifeq ($(OS_ARCH), Darwin)
@ -43,7 +47,7 @@ $(PROGRAM): $(OBJS)
$(STRIP) $(STRIP_ARGS) $(PROGRAM) $(STRIP) $(STRIP_ARGS) $(PROGRAM)
clean: clean:
rm -f $(PROGRAM) *.o rm -f $(PROGRAM) $(OBJS)
distclean: clean distclean: clean
rm -f .dependencies rm -f .dependencies
@ -55,7 +59,7 @@ install: $(PROGRAM)
mkdir -p $(DESTDIR)$(PREFIX)/sbin mkdir -p $(DESTDIR)$(PREFIX)/sbin
$(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8 mkdir -p $(DESTDIR)$(PREFIX)/share/man/man8
$(INSTALL) $(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8 $(INSTALL) cli/$(PROGRAM).8 $(DESTDIR)$(PREFIX)/share/man/man8
.PHONY: all clean distclean dep .PHONY: all clean distclean dep

View File

@ -682,8 +682,7 @@ static void parse_assignment(char arg[], const char **name, const char **value)
regmatch_t match[N_MATCHES]; regmatch_t match[N_MATCHES];
regex_t assignment; regex_t assignment;
compile_reg_exprs(REG_EXTENDED | REG_NEWLINE, 1, assignment_regex, compile_reg_expr(REG_EXTENDED | REG_NEWLINE, assignment_regex, &assignment);
&assignment);
/* Does 'arg' conform to proper assignment syntax? If not, exit with a /* Does 'arg' conform to proper assignment syntax? If not, exit with a
* usage message. * usage message.
@ -699,7 +698,7 @@ static void parse_assignment(char arg[], const char **name, const char **value)
*name = &arg[match[1].rm_so]; *name = &arg[match[1].rm_so];
*value = &arg[match[2].rm_so]; *value = &arg[match[2].rm_so];
free_reg_exprs(1, &assignment); regfree(&assignment);
} }
/**************************************************************************** /****************************************************************************