Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110724174151.GB19529@openwall.com>
Date: Sun, 24 Jul 2011 21:41:51 +0400
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: Plugin formats "released"

Jim, magnum -

On Sun, Jul 24, 2011 at 03:01:25AM -0500, JFoug wrote:
> the line:
> PLUGFORMATS_SRCS: sh =if [ -f *_plug.c ]; then ls *_plug.c; fi
> is a no-op on gmake.  However, on solaris make, it builds a list of all 
> *_plug.c files
> PLUGFORMATS_SRCS += $(shell ls *_plug.c)
> is a no-op on solaris make, but fills in the *_plug.c files on gmake (it is 
> older syntax for gmake, but works fine).
> 
> The PLUGFORMATS_SRCS = $(wildcard *_plug.c)   simply fails to run at all on 
> solaris, the make process dies here.
> 
> The $(shell ls *_plug.c) appears like it was 'supposed' to work for 
> solaris, and some documentation magnum found listed it also, however, it 
> did not work.  I found the sh =if.....fi on  a solaris forum, and that was 
> the only way we were able to get it to work, for that make.

My guess is that between:

PLUGFORMATS_SRCS = $(wildcard *_plug.c)

and:

PLUGFORMATS_SRCS += $(shell ls *_plug.c)

it's the "+=" that helps have the line ignored by Solaris make, not the
"wildcard" vs. "shell" change.

> >Then, I did not like the grep|sed|awk commands, which I simplified to
> >single invocations of sed:
> >
> >fmt_externs.h: $(PLUGFORMATS_SRCS) Makefile
> >$(SED) -n 's/^\(struct fmt_main [^ ]\+\) =.*/extern \1;/p' *_fmt_plug.c > 
> >fmt_externs.h
> >
> >fmt_registers.h: $(PLUGFORMATS_SRCS) Makefile
> >$(SED) -n 's/^struct fmt_main \([^ ]\+\) =.*/john_register_one(\&\1);/p' 
> >*_fmt_plug.c > fmt_registers.h
> >
> >john.o: john.c fmt_externs.h fmt_registers.h
> >$(CC) $(CFLAGS) $(OPT_NORMAL) john.c
> 
> Simpiler, but the older method also put a comment on each line, listing 
> what file contained the format structure.  That was nice for editors which 
> have click/open capability.  Those were nice files to have open, you could 
> get to any plugin format .C file easily.

I intentionally didn't bother to preserve those comments in my revised
commands.  I did not realize that they were to be used along with that
editor feature you mention.  Now that I do, I find it a questionable
benefit, arguably not worth the increased likelihood of build failures
on some less common platforms (through the more complicated commands run
from the Makefile).

Thanks,

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.