[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Change of the Makefile
From: |
Michael Song |
Subject: |
Change of the Makefile |
Date: |
Tue, 20 Sep 2005 06:44:41 -0700 |
Hello, Shell Community
My name is Michael Song
Recently I found shell is a nice program that can be extended to solve my
automatic regression test problem. So I started hacking it.
I found it would be easiler use $(wildcard) in the builtins/Makefile.in, in
stead of staticly specify all the source files:
Here is the snippet of code change to illustrate my idea:
In builtins/Makefile.in
Original Definition:
DEFSRC = $(srcdir)/alias.def $(srcdir)/bind.def $(srcdir)/break.def \
$(srcdir)/builtin.def $(srcdir)/caller.def \
$(srcdir)/cd.def $(srcdir)/colon.def \
$(srcdir)/command.def $(srcdir)/declare.def $(srcdir)/echo.def \
$(srcdir)/enable.def $(srcdir)/eval.def $(srcdir)/getopts.def \
$(srcdir)/exec.def $(srcdir)/exit.def $(srcdir)/fc.def \
$(srcdir)/fg_bg.def $(srcdir)/hash.def $(srcdir)/help.def \
$(srcdir)/history.def $(srcdir)/jobs.def $(srcdir)/kill.def \
$(srcdir)/let.def $(srcdir)/read.def $(srcdir)/return.def \
$(srcdir)/set.def $(srcdir)/setattr.def $(srcdir)/shift.def \
$(srcdir)/source.def $(srcdir)/suspend.def $(srcdir)/test.def \
$(srcdir)/times.def $(srcdir)/trap.def $(srcdir)/type.def \
$(srcdir)/ulimit.def $(srcdir)/umask.def $(srcdir)/wait.def \
$(srcdir)/pushd.def $(srcdir)/shopt.def \
$(srcdir)/printf.def $(srcdir)/complete.def
Proposed Definition:
DEFSRC = $(wildcard $(srcdir)/*.def)
clean:
$(RM) -rf $(patsubst %.def, %.c, $(DEFSRC)) $(CREATED_FILES)
$(MKBUILTINS) *.o libbuiltins.a -r helpfiles
This wild card works based on the assumption that the reserved.def file is
renamed to something else
In the Makefile.in under the root, the change is as follows:
Original Definition:
BUILTIN_DEFS = $(DEFSRC)/alias.def $(DEFSRC)/bind.def $(DEFSRC)/break.def \
$(DEFSRC)/builtin.def $(DEFSRC)/cd.def $(DEFSRC)/colon.def \
$(DEFSRC)/command.def ${DEFSRC}/complete.def \
$(DEFSRC)/caller.def $(DEFSRC)/declare.def \
$(DEFSRC)/echo.def $(DEFSRC)/enable.def $(DEFSRC)/eval.def \
$(DEFSRC)/exec.def $(DEFSRC)/exit.def $(DEFSRC)/fc.def \
$(DEFSRC)/fg_bg.def $(DEFSRC)/hash.def $(DEFSRC)/help.def \
$(DEFSRC)/history.def $(DEFSRC)/jobs.def $(DEFSRC)/kill.def \
$(DEFSRC)/let.def $(DEFSRC)/read.def $(DEFSRC)/return.def \
$(DEFSRC)/set.def $(DEFSRC)/setattr.def $(DEFSRC)/shift.def \
$(DEFSRC)/source.def $(DEFSRC)/suspend.def $(DEFSRC)/test.def \
$(DEFSRC)/times.def $(DEFSRC)/trap.def $(DEFSRC)/type.def \
$(DEFSRC)/ulimit.def $(DEFSRC)/umask.def $(DEFSRC)/wait.def \
$(DEFSRC)/getopts.def \
$(DEFSRC)/pushd.def $(DEFSRC)/shopt.def $(DEFSRC)/printf.def
New Definition:
BUILTIN_DEFS = $(wildcard $(DEFSRC)/*.def)
OFILES = builtins.o $(patsubst %.def, %.o, $(DEFSRC)) $(patsubst %.c, %.o,
$(STATIC_SOURCE))
Thanks
Michael Song
- Change of the Makefile,
Michael Song <=