--- rpl/tools/Makefile.am 2010/08/06 15:25:50 1.19 +++ rpl/tools/Makefile.am 2012/04/17 07:45:10 1.64 @@ -1,15 +1,26 @@ EXTRA_DIST = @NCURSES@.tar.gz @READLINE@.tar.gz @UNITS@.tar.gz @GSL@.tar.gz \ @GPP@.tar.gz @GNUPLOT@.tar.gz @FILE@.tar.gz @ICONV@.tar.gz \ - @FILE@.diff.gz @SQLITE@.tar.gz @SQLITE@.diff.gz @OPENSSL@.tar.gz + @FILE@.diff.gz @SQLITE@.tar.gz @OPENSSL@.tar.gz \ + @OPENMOTIF@.tar.gz @SIGSEGV@.tar.gz @LIBXPM@.tar.gz \ + @NCURSES@-20111224.sh.gz \ + @NCURSES@-20111231.patch.gz @NCURSES@-20120107.patch.gz \ + @NCURSES@-20120114.patch.gz @NCURSES@-20120121.patch.gz \ + @NCURSES@-20120128.patch.gz @NCURSES@-20120204.patch.gz \ + @NCURSES@-20120211.patch.gz @NCURSES@-20120218.patch.gz \ + @NCURSES@-20120225.patch.gz @NCURSES@-20120228.patch.gz \ + @NCURSES@-20120303.patch.gz @NCURSES@-20120310.patch.gz \ + @NCURSES@-20120317.patch.gz @NCURSES@-20120324.patch.gz \ + @NCURSES@-20120331.patch.gz @NCURSES@-20120407.patch.gz \ + @NCURSES@-20120414.patch.gz subdirs = @NCURSES@ @READLINE@ @UNITS@ @GSL@ @GPP@ @GNUPLOT_COMPILATION@ \ - @FILE@ @ICONV@ @SQLITE@ @OPENSSL@ + @FILE@ @ICONV@ @SQLITE@ @OPENSSL@ @SIGSEGV@ @BUILD_OPENMOTIF@ all: - TMP=$$(mktemp tmp.XXXXXXXXXX); \ - sed s/DREADLINE/UREADLINE/g @UNITS@/Makefile | \ - sed s/-lreadline//g | sed s/-lncurses//g > $$TMP; \ - \mv -f $$TMP @UNITS@/Makefile + TMP=tmp.tools; \ + sed -e 's/DREADLINE/UREADLINE/g' @UNITS@/Makefile | \ + sed -e 's/-lreadline//g' | sed -e 's/-lncurses//g' > $$TMP; \ + mv -f $$TMP @UNITS@/Makefile @list='$(subdirs)'; for subdir in $$list; do \ echo "Making $@ in $$subdir"; \ if [ $$subdir = @OPENSSL@ ]; then \ @@ -19,25 +30,31 @@ all: $(MAKE) -C $$subdir -j1 $@; \ fi; \ else \ - if [ $$subdir = @GSL@ -a @OS@ = "OS2" ]; then \ - $(MAKE) -C $(top_builddir) \ - tools/$(top_builddir)/tools/@GSL@/.libs/libgsl.a; \ - else \ - $(MAKE) -C $$subdir $@; \ + if [ $$subdir = @UNITS@ -a @OS@ = OpenBSD ]; then \ + TMP=tmp.units; \ + sed -e 's/^DEFS = -DUNITSFILE/DEFS = -Dmalloc=malloc -DUNITSFILE/g' \ + @UNITS@/Makefile > $$TMP; \ + mv -f $$TMP @UNITS@/Makefile; \ fi; \ + $(MAKE) -C $$subdir $@; \ fi; \ done; if [ ! -f @OPENSSL@/tests_success ]; then \ - if [ @OS@ = "OS2" ]; then \ + if [ @OS@ = "OS2" -o @RPLTOOLS@ != '\$(top_builddir)' ]; then \ (cd @OPENSSL@ && touch tests_success); \ else \ - (cd @OPENSSL@ && $(MAKE) test && touch tests_success); \ + (cd @OPENSSL@ && $(MAKE) -j1 test && touch tests_success); \ fi; \ fi - $(CC) -o $(top_builddir)/tools/@FILE@/src/rplfile$(EXEEXT) \ - $(top_builddir)/tools/@FILE@/src/*.o \ - $(shell grep '^LIBS =' $(top_builddir)/tools/@FILE@/Makefile | \ - cut -d= -f2) $(LDFLAGS) + touch openmotif.lib && rm openmotif.lib; + if [ x"@BUILD_OPENMOTIF@" = x ]; then \ + touch openmotif.lib; \ + else \ + echo -n LD_MOTIF_ > openmotif.lib; \ + grep "^LIBS=" @OPENMOTIF@/config.log | tr -d "'" >> openmotif.lib; \ + echo -n LD_MOTIF_ >> openmotif.lib; \ + grep "^X_XMU" @OPENMOTIF@/config.log | tr -d "'" >> openmotif.lib; \ + fi clean distclean: @list='$(subdirs)'; for subdir in $$list; do \ @@ -47,8 +64,11 @@ clean distclean: fi; \ done; if [ -f @OPENSSL@/tests_success ]; then \ - \rm -f @OPENSSL@/tests_success; \ + rm -f @OPENSSL@/tests_success; \ fi + rm -f $(DESTDIR)$(bindir)/rplconvert$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/rplpp$(EXEEXT) + rm -f $(DESTDIR)$(bindir)/rplfile$(EXEEXT) install: all $(mkinstalldirs) $(DESTDIR)$(bindir) @@ -69,7 +89,7 @@ install: all $(DESTDIR)$(bindir)/rplfile$(EXEEXT) uninstall: - \rm -f $(DESTDIR)$(bindir)/rplconvert$(EXEEXT) \ + rm -f $(DESTDIR)$(bindir)/rplconvert$(EXEEXT) \ $(DESTDIR)$(datadir)/rplunits \ $(DESTDIR)$(bindir)/rplpp$(EXEEXT) \ $(DESTDIR)$(mandir)/man1/gpp.1 \