Skip to content

Commit

Permalink
make: workaround for backwards compat. with make 3.80
Browse files Browse the repository at this point in the history
- workaround for export not supported in gnu make 3.80 target
  specific variables: use $(mk_params) for each $(MAKE) invocation
  • Loading branch information
poandrei committed Apr 2, 2009
1 parent 25ba1f0 commit 724ca08
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Requirements:
- bison or yacc (Berkley yacc)
- flex
- GNU make (on Linux this is the standard "make", on *BSD and Solaris is
called "gmake") version >= 3.79.
called "gmake") version >= 3.80.
- sed and tr (used in the makefiles)
- GNU tar ("gtar" on Solaris) and gzip if you want "make tar" to work
- GNU install, BSD install or Solaris install if you want "make
Expand Down
28 changes: 18 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
# added cfg-defs, new target that only rebuilds config.mak
# 2009-03-10 replaced DEFS with C_DEFS (DEFS are now used only for
# "temporary" defines inside modules or libs) (andrei)
# 2009-04-02 workaround for export not supported in gnu make 3.80
# target specific variables: use mk_params for each
# $(MAKE) invocation (andrei)
#

auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
Expand Down Expand Up @@ -381,7 +384,8 @@ modules: modules.lst
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
if $(MAKE) -C $$r $(mk_params) || [ ${err_fail} != 1 ] ; \
then\
:; \
else \
exit 1; \
Expand All @@ -395,7 +399,7 @@ $(extra_objs):
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
echo "" ; \
echo "Making static module $r" ; \
if $(MAKE) -C $$r static ; then \
if $(MAKE) -C $$r static $(mk_params) ; then \
:; \
else \
exit 1; \
Expand All @@ -409,7 +413,8 @@ utils:
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r || [ ${err_fail} != 1 ] ; then \
if $(MAKE) -C $$r $(mk_params) || [ ${err_fail} != 1 ] ; \
then \
:; \
else \
exit 1; \
Expand Down Expand Up @@ -466,7 +471,7 @@ tar:
.PHONY: bin
bin:
mkdir -p tmp/ser/usr/local
$(MAKE) install basedir=tmp/ser
$(MAKE) install basedir=tmp/ser $(mk_params)
$(TAR) -C tmp/ser/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
rm -rf tmp/ser

Expand All @@ -484,7 +489,7 @@ deb:
sunpkg:
mkdir -p tmp/ser
mkdir -p tmp/ser_sun_pkg
$(MAKE) install basedir=tmp/ser prefix=/usr/local
$(MAKE) install basedir=tmp/ser prefix=/usr/local $(mk_params)
(cd pkg/solaris; \
pkgmk -r ../../tmp/ser/usr/local -o -d ../../tmp/ser_sun_pkg/ -v "$(RELEASE)" ;\
cd ../..)
Expand All @@ -501,7 +506,7 @@ modules-doc: modules.lst
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
$(MAKE) -C $$r/doc $(doc_format) ; \
$(MAKE) -C $$r/doc $(doc_format) $(mk_params); \
fi ; \
done

Expand All @@ -514,7 +519,8 @@ README: modules.lst
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r README || [ ${err_fail} != 1 ] ; then \
if $(MAKE) -C $$r README $(mk_params) || \
[ ${err_fail} != 1 ] ; then \
:; \
else \
exit 1; \
Expand All @@ -531,7 +537,8 @@ man: modules.lst
if [ -n "$$r" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r man || [ ${err_fail} != 1 ] ; then \
if $(MAKE) -C $$r man $(mk_params) || [ ${err_fail} != 1 ] ; \
then \
:; \
else \
exit 1; \
Expand All @@ -540,7 +547,7 @@ man: modules.lst
done; true

.PHONY: install
install: export compile_for_install=yes
install: mk_params="compile_for_install=yes"
install: install-bin install-modules install-cfg \
install-doc install-man install-utils install-share

Expand Down Expand Up @@ -636,7 +643,8 @@ install-modules: modules.lst $(modules_prefix)/$(modules_dir)
if [ -n "$$r" -a -r "$$r/Makefile" ]; then \
echo "" ; \
echo "" ; \
if $(MAKE) -C $$r install || [ ${err_fail} != 1 ] ; then \
if $(MAKE) -C $$r install $(mk_params) || \
[ ${err_fail} != 1 ] ; then \
:; \
else \
exit 1; \
Expand Down

0 comments on commit 724ca08

Please sign in to comment.