New makefile nitpick

Dan Nicholson dbn.lists at
Fri Sep 15 14:30:22 PDT 2006

On 9/15/06, George Boudreau <georgeb at> wrote:
> >
>    Rather than have the user play with the sudoers file I will add this
> line to the generated Makefile.
> export PATH := ${PATH}:/usr/sbin
>    If the user already has /usr/sbin in his/her PATH then this will be
> redundant. YES, I could check for and not add the additional path if it
> already existed but this is a cheap and dirty fix.

First, I like it better to just put the needed paths in the Makefile
than to silently expect them to be there. Here's an alternative that
bombs if /sbin or /usr/sbin aren't in the path. Then the user can put
it where they want.

$ cat Makefile
all: checkpaths
ifeq (,$(findstring /sbin,$(subst :, ,$(PATH))))
        $(error You must have /sbin in your PATH!)
ifeq (,$(findstring /usr/sbin,$(subst :, ,$(PATH))))
        $(error You must have /usr/sbin in your PATH!)
$ make
Makefile:6: *** You must have /sbin in your PATH!.  Stop.
$ PATH=/sbin:$PATH
$ make
Makefile:9: *** You must have /usr/sbin in your PATH!.  Stop.
$ PATH=/usr/sbin:$PATH
$ make
afind         dummy.s                   Makefile  
arg           filelist                  newer     
backup1.snar                    progress            timestamp
backup1.tar   gcc-glibc-corruption.txt        trace
dbnb          glibc-build-desaster      prototype.tar.bz2   ziptest
dummy.c       glibc-desaster2 
dummy.i       grub_glibc_error.txt      scriptlets.tar.bz2


More information about the alfs-discuss mailing list