Yeah, the portability angle is why I'm trying to move forward
carefully. That said, isn't GNU Make everywhere these days? Couldn't
we eliminate a lot of complexity by relying on its include syntax (and
other treats)? I'm still a n00b on this scene, so I don't aim to
offend anyone, but it's an honest, if naive question.

Also, I've been piling up a few build-related commits in
https://github.com/openssl/openssl/pull/145, including "Add .d files
to 'make clean' targets" and "Configure dependency-generating compiler
flags". (I won't link to the commit hashes because I keep rebasing
that branch on openssl/master.) I'd be interested in hearing what
folks think of them.

Mike

On Tue, Jul 1, 2014 at 4:57 PM, Theodore Ts'o <ty...@mit.edu> wrote:
> On Tue, Jul 01, 2014 at 02:10:31PM -0400, Mike Bland wrote:
>> I was wondering why 'make depend' output was saved in the Makefiles.
>> So I guess adding the .d files to the repository and using include
>> statements in the Makefiles is a reasonable possibility? (That's the
>> angle I'm taking with my experiment, though I hadn't thought to add
>> the .d's to the repo.)
>
> The problem with using include statements in Makefiles is that's not
> particularly portable.  So what I do in e2fsprogs is to modify the
> Makefile.in files directly (since I use autoconf, but NOT automake or
> libtool):
>
> .depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
>         if test -n "$(SRCS)" ; then \
>                 $(CC) -M $(ALL_CFLAGS) $(DEPEND_CFLAGS) $(SRCS) | \
>                         $(SED) -f $(top_srcdir)/depfix.sed \
>                             -e 's; $(srcdir)/; $$(srcdir)/;g' \
>                             -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
>                             -e 's; $(top_builddir)/; $$(top_builddir)/;g' \
>                             -e 's; \./; ;g' \
>                             -e '/^#/d' \
>                             -e '/^ *\\$$/d' | \
>                         $(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
>         else :; fi
>
> depend:: .depend
>         if test -n "$(SRCS)" ; then \
>                 sed -e '/^# +++ Dependency line eater +++/,$$d' \
>                         < $(srcdir)/Makefile.in | cat - .depend \
>                         > $(srcdir)/Makefile.in.new; \
>         if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
>                 $(RM) $(srcdir)/Makefile.in.new ; \
>         else \
>                 $(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
>                 $(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
>         fi ; else :; fi
>
> ... and where depfix.sed is a sed script that strips out the system
> header files, so that the resulting dependencies are portable across
> different OS's.  So this matches OpenSSL's requirements, I think.  Gcc
> is required to update the dependencies, but it's not required for
> people who are building on systems that have old-style makes,
> including ones that go as far back as Solaris 2.x, AIX, etc.  (This is
> a modified and updated version of something that I had originally
> created for MIT Kerberos, which had a very wide portability
> requirement, including creating NMAKE compatible files for a very old
> version of Visual Studio, as well as makefiles that would work with
> Apple's MPW.  :-)
>
>                                         - Ted
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       openssl-dev@openssl.org
> Automated List Manager                           majord...@openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to