comparison src/Makefile.am @ 9906:8d20fb66a0dc

more automake fixes
author John W. Eaton <jwe@octave.org>
date Thu, 03 Dec 2009 15:39:20 -0500
parents 1355a606667e
children 1020d800d342
comparison
equal deleted inserted replaced
9905:84a7c11ff928 9906:8d20fb66a0dc
29 AM_CPPFLAGS = \ 29 AM_CPPFLAGS = \
30 @CPPFLAGS@ -I$(top_srcdir)/libcruft/misc -I../liboctave -I$(top_srcdir)/liboctave -I. -I$(srcdir) 30 @CPPFLAGS@ -I$(top_srcdir)/libcruft/misc -I../liboctave -I$(top_srcdir)/liboctave -I. -I$(srcdir)
31 31
32 AUTOMAKE_OPTIONS = subdir-objects 32 AUTOMAKE_OPTIONS = subdir-objects
33 33
34 BUILT_DISTFILES = \ 34 ## Order matters here. Leave builtins.cc last, because it depends on
35 DOCSTRINGS \ 35 ## $(DEF_FILES), and building those requires all the sources
36 ## (except builtins.cc) to be available. List only one of graphics.h
37 ## and graphics-props.cc because if both are listed, building in
38 ## parallel will fail.
39 BUILT_SOURCES = \
40 defaults.h \
41 graphics.h \
42 lex.cc \
43 mxarray.h \
44 oct-conf.h \
45 oct-errno.cc \
36 oct-gperf.h \ 46 oct-gperf.h \
37 oct-parse.cc \ 47 oct-parse.cc \
38 oct-parse.h \ 48 ops.cc \
39 lex.cc \ 49 version.h \
50 builtins.cc
51
52 BUILT_DISTFILES = \
53 oct-gperf.h \
54 oct-parse.h
55
56 ## FIXME -- These files don't need to be distributed. Some of them
57 ## do need to be installed. So we need to add them to a list somewhere
58 ## so that happens correctly.
59 BUILT_NODISTFILES = \
60 defaults.h \
61 graphics.h \
62 oct-conf.h \
63 oct-errno.cc \
64 ops.cc \
65 mxarray.h \
66 version.h \
40 $(OPT_HANDLERS) \ 67 $(OPT_HANDLERS) \
41 $(OPT_INC) 68 $(OPT_INC) \
69 $(DEF_FILES) \
70 builtins.cc
42 71
43 EXTRA_DIST = \ 72 EXTRA_DIST = \
44 ChangeLog \ 73 ChangeLog \
45 Makefile.in \ 74 Makefile.in \
46 defaults.h.in \ 75 defaults.h.in \
55 mkops \ 84 mkops \
56 mxarray.h.in \ 85 mxarray.h.in \
57 oct-conf.h.in \ 86 oct-conf.h.in \
58 oct-errno.cc.in \ 87 oct-errno.cc.in \
59 octave.gperf \ 88 octave.gperf \
89 version.h.in \
60 $(BUILT_DISTFILES) 90 $(BUILT_DISTFILES)
61 91
62 DLL_CDEFS = @OCTINTERP_DLL_DEFS@ 92 DLL_CDEFS = @OCTINTERP_DLL_DEFS@
63 DLL_CXXDEFS = @OCTINTERP_DLL_DEFS@ 93 DLL_CXXDEFS = @OCTINTERP_DLL_DEFS@
64 94
65 .cc.df: 95 .cc.df:
66 @echo making $@ from $< 96 (echo "// DO NOT EDIT! Generated automatically by mkdefs." ; \
67 @(echo "// DO NOT EDIT! Generated automatically by mkdefs." ; \ 97 case "$<" in \
68 echo " XDEFUN_FILE_NAME (\"$<\")" ; \ 98 $(srcdir)/*) xsrcdir="`echo $< | sed 's,^$(srcdir),src,'`" ;; \
99 *) xsrcdir="src/$<" ;; \
100 esac ; \
101 echo " XDEFUN_FILE_NAME (\"$$xsrcdir\")" ; \
69 egrep '^(///*|/\*) *PKG_ADD:' $< ; \ 102 egrep '^(///*|/\*) *PKG_ADD:' $< ; \
70 $(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 103 $(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
71 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \ 104 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
72 -DMAKE_BUILTINS $< | $(srcdir)/mkdefs) > $@-t 105 -DMAKE_BUILTINS $< | $(srcdir)/mkdefs) > $@-t
73 @mv $@-t $@ 106 mv $@-t $@
74 107
75 OPT_HANDLERS = \ 108 OPT_HANDLERS = \
76 DASPK-opts.cc \ 109 DASPK-opts.cc \
77 DASRT-opts.cc \ 110 DASRT-opts.cc \
78 DASSL-opts.cc \ 111 DASSL-opts.cc \
442 475
443 liboctinterp_la_SOURCES = \ 476 liboctinterp_la_SOURCES = \
444 $(DIST_SRC) \ 477 $(DIST_SRC) \
445 $(DLD_STATIC_SRC) \ 478 $(DLD_STATIC_SRC) \
446 $(OPERATORS_SRC) \ 479 $(OPERATORS_SRC) \
480 $(OPT_HANDLERS) \
447 $(TEMPLATE_INST_SRC) 481 $(TEMPLATE_INST_SRC)
448 482
449 DLD_DYNAMIC_DEF_FILES = $(DLD_DYNAMIC_SRC:.cc=.df) 483 DLD_DYNAMIC_DEF_FILES = $(DLD_DYNAMIC_SRC:.cc=.df)
450 DLD_STATIC_DEF_FILES = $(DLD_STATIC_SRC:.cc=.df) 484 DLD_STATIC_DEF_FILES = $(DLD_STATIC_SRC:.cc=.df)
451 485
452 SRC_DEF_FILES := $(shell $(srcdir)/find-defun-files.sh "$(srcdir)" $(DIST_SRC)) 486 SRC_DEF_FILES := $(shell $(srcdir)/find-defun-files.sh "$(srcdir)" $(DIST_SRC))
453 487
454 DEF_FILES = $(SRC_DEF_FILES) $(DLD_DYNAMIC_DEF_FILES) $(DLD_STATIC_DEF_FILES) 488 DEF_FILES = $(SRC_DEF_FILES) $(DLD_DYNAMIC_DEF_FILES) $(DLD_STATIC_DEF_FILES)
489
490 $(DEF_FILES): mkdefs Makefile
455 491
456 if AMCOND_ENABLE_DYNAMIC_LINKING 492 if AMCOND_ENABLE_DYNAMIC_LINKING
457 OCTAVE_LIBS = \ 493 OCTAVE_LIBS = \
458 ./liboctinterp.la \ 494 ./liboctinterp.la \
459 ../liboctave/liboctave.la \ 495 ../liboctave/liboctave.la \
536 572
537 liboctinterp_la_CPPFLAGS = @OCTINTERP_DLL_DEFS@ $(AM_CPPFLAGS) 573 liboctinterp_la_CPPFLAGS = @OCTINTERP_DLL_DEFS@ $(AM_CPPFLAGS)
538 574
539 liboctinterp_la_LDFLAGS = -release $(version) $(NO_UNDEFINED_LDFLAG) 575 liboctinterp_la_LDFLAGS = -release $(version) $(NO_UNDEFINED_LDFLAG)
540 576
541 ## Order matters here. Leave builtins.cc last, because it depends on 577 CLEANFILES = \
542 ## $(DEF_FILES), and building those requires all the sources 578 DLD-FUNCTIONS/PKG_ADD \
543 ## (except builtins.cc) to be available. List only one of graphics.h 579 doc-files \
544 ## and graphics-props.cc because if both are listed, building in 580 gendoc.cc \
545 ## parallel will vail. 581 gendoc$(BUILD_EXEEXT) \
546 BUILT_SOURCES = \ 582 graphics-props.cc \
547 defaults.h \ 583 oct-parse.output \
548 graphics.h \ 584 $(BUILT_NODISTFILES)
549 lex.cc \ 585
550 oct-conf.h \ 586 MAINTAINERCLEANFILES = \
551 oct-errno.cc \ 587 $(BUILT_DISTFILES)
552 oct-gperf.h \
553 oct-parse.cc \
554 ops.cc \
555 $(OPT_HANDLERS) \
556 $(OPT_INC) \
557 builtins.cc
558
559 CLEANFILES = $(BUILT_SOURCES)
560 588
561 octave_LDADD = $(OCTAVE_LIBS) 589 octave_LDADD = $(OCTAVE_LIBS)
562 590
563 all-local: $(OCT_FILES) DLD-FUNCTIONS/PKG_ADD DOCSTRINGS 591 all-local: $(OCT_FILES) DLD-FUNCTIONS/PKG_ADD DOCSTRINGS
564 592
569 AM_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(AM_CXXFLAGS) $(GRAPHICS_CFLAGS)) 597 AM_CXXFLAGS := $(filter-out $(DLL_CXXDEFS), $(AM_CXXFLAGS) $(GRAPHICS_CFLAGS))
570 598
571 # XERBLA = ../libcruft/blas-xtra/xerbla.o 599 # XERBLA = ../libcruft/blas-xtra/xerbla.o
572 600
573 builtins.cc: $(DEF_FILES) mkbuiltins 601 builtins.cc: $(DEF_FILES) mkbuiltins
574 @echo making $@ 602 $(srcdir)/mkbuiltins $(DEF_FILES) > $@-t
575 @echo DEF_FILES = $(DEF_FILES) 603 mv $@-t $@
576 @echo $(DEF_FILES) > def-files 604
577 @$(srcdir)/mkbuiltins def-files > $@-t 605 mxarray.h: mxarray.h.in Makefile
578 @mv $@-t $@ 606 $(SED) < $< \
579 607 -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t
580 ## FIXME -- maybe genprops.awk should write both output files? 608 mv $@-t $@
581 ## Or maybe there should be separate commands to generate each file? 609
582 graphics.h graphics-props.cc: graphics.h.in genprops.awk 610 version.h: version.h.in Makefile
583 @echo making graphics.h and graphics-props.cc 611 $(SED) < $< \
584 @$(AWK) -f $(srcdir)/genprops.awk $< > graphics.h-t 612 -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
585 @mv graphics.h-t graphics.h 613 -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
586 614 -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
587 DLD-FUNCTIONS/PKG_ADD: $(DLD_DYNAMIC_DEF_FILES) 615 -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|" > $@-t
616 mv $@-t $@
617
618 graphics.h: graphics.h.in genprops.awk Makefile
619 $(AWK) -f $(srcdir)/genprops.awk $< > $@-t
620 mv $@-t $@
621
622 graphics-props.cc: graphics.h.in genprops.awk Makefile
623 $(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t
624 mv $@-t $@
625
626 DLD-FUNCTIONS/PKG_ADD: $(DLD_DYNAMIC_DEF_FILES) mk-pkg-add
588 $(srcdir)/mk-pkg-add $(DLD_DYNAMIC_DEF_FILES) > $@-t 627 $(srcdir)/mk-pkg-add $(DLD_DYNAMIC_DEF_FILES) > $@-t
589 @mv $@-t $@ 628 mv $@-t $@
590 629
591 DOCSTRINGS: gendoc$(BUILD_EXEEXT) 630 DOCSTRINGS: gendoc$(BUILD_EXEEXT)
592 @echo making $@ 631 ./gendoc > $@-t
593 @./gendoc > $@-t 632 mv $@-t $@
594 @mv $@-t $@
595 633
596 doc-files: $(DEF_FILES) 634 doc-files: $(DEF_FILES)
597 @echo making $@ 635 echo $(DEF_FILES) > $@-t
598 @echo DEF_FILES = $(DEF_FILES)
599 @echo $(DEF_FILES) > $@-t
600 mv $@-t $@ 636 mv $@-t $@
601 637
602 gendoc.cc: doc-files mkgendoc 638 gendoc.cc: doc-files mkgendoc
603 @echo making $@ 639 $(srcdir)/mkgendoc $(srcdidr) doc-files > $@-t
604 @$(srcdir)/mkgendoc doc-files > $@-t 640 mv $@-t $@
605 @mv $@-t $@
606 641
607 gendoc$(BUILD_EXEEXT): gendoc.cc 642 gendoc$(BUILD_EXEEXT): gendoc.cc
608 $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) 643 $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS)
609 644
610 ops.cc: $(OPERATORS_SRC) mkops 645 ops.cc: $(OPERATORS_SRC) mkops
611 @echo making $@ from $(OPERATORS_SRC) 646 $(srcdir)/mkops $(OPERATORS_SRC) > $@-t
612 @$(srcdir)/mkops $(OPERATORS_SRC) > $@-t 647 mv $@-t $@
613 @mv $@-t $@
614 648
615 $(DEF_FILES): $(OPT_INC) mkdefs 649 $(DEF_FILES): $(OPT_INC) mkdefs
616 650
617 install-exec-hook: make-version-links 651 install-exec-hook: make-version-links
618 652
661 .PHONY: install-oct uninstall-oct 695 .PHONY: install-oct uninstall-oct
662 696
663 # Special rules -- these files need special things to be defined. 697 # Special rules -- these files need special things to be defined.
664 698
665 $(OPT_HANDLERS) : %.cc : $(top_srcdir)/liboctave/%.in $(top_srcdir)/mk-opts.pl 699 $(OPT_HANDLERS) : %.cc : $(top_srcdir)/liboctave/%.in $(top_srcdir)/mk-opts.pl
666 @echo making $@ from $< 700 $(PERL) $(top_srcdir)/mk-opts.pl --opt-handler-fcns $< > $@-t
667 @$(PERL) $(top_srcdir)/mk-opts.pl --opt-handler-fcns $< > $@-t 701 mv $@-t $@
668 @mv $@-t $@
669 702
670 ## We require Bison. 703 ## We require Bison.
671 #parse.cc : parse.y 704 #parse.cc : parse.y
672 # @echo "expect 14 shift/reduce conflicts" 705 # @echo "expect 14 shift/reduce conflicts"
673 # $(YACC) $(YFLAGS) --output=$@ --defines=y.tab.h $< 706 # $(YACC) $(YFLAGS) --output=$@ --defines=y.tab.h $<
685 ## line or the environment. The substitution rules use move-if-change, 718 ## line or the environment. The substitution rules use move-if-change,
686 ## so this should not cause trouble if the file already exists and the 719 ## so this should not cause trouble if the file already exists and the
687 ## newly generated file is not different. 720 ## newly generated file is not different.
688 721
689 defaults.h: defaults.h.in Makefile 722 defaults.h: defaults.h.in Makefile
690 @$(do_subst_default_vals) 723 $(do_subst_default_vals)
691 724
692 oct-conf.h: oct-conf.h.in Makefile 725 oct-conf.h: oct-conf.h.in Makefile
693 @$(do_subst_config_vals) 726 $(do_subst_config_vals)
694 727
695 oct-errno.cc: oct-errno.cc.in Makefile 728 oct-errno.cc: oct-errno.cc.in Makefile
696 @echo "making $@ from $<" 729 if test -n "$(PERL)"; then \
697 @if test -n "$(PERL)"; then \
698 $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \ 730 $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \
699 elif test -n "$(PYTHON)"; then \ 731 elif test -n "$(PYTHON)"; then \
700 $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \ 732 $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \
701 else \ 733 else \
702 $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \ 734 $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \
703 fi 735 fi
704 @mv $@-t $@ 736 mv $@-t $@
705 737
706 ## Don't use a pipeline to process gperf output since if gperf 738 ## Don't use a pipeline to process gperf output since if gperf
707 ## is missing but sed is not, the exit status of the pipeline 739 ## is missing but sed is not, the exit status of the pipeline
708 ## will still be success and we will end up creating an empty 740 ## will still be success and we will end up creating an empty
709 ## oct-gperf.h file. 741 ## oct-gperf.h file.
710 oct-gperf.h: octave.gperf 742 oct-gperf.h: octave.gperf
711 $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 743 $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1
712 $(SED) 's,lookup\[,gperf_lookup[,' < $@-t1 > $@-t2 744 $(SED) 's,lookup\[,gperf_lookup[,' < $@-t1 > $@-t
713 mv $@-t2 $@ 745 mv $@-t $@
714 rm -f $@-t1 746 rm -f $@-t1
715 747
716 display.df display.lo: CPPFLAGS += $(X11_FLAGS) 748 display.df display.lo: CPPFLAGS += $(X11_FLAGS)
717 749
718 DLD-FUNCTIONS/__magick_read__.df: CPPFLAGS += $(MAGICK_CPPFLAGS) 750 DLD-FUNCTIONS/__magick_read__.df: CPPFLAGS += $(MAGICK_CPPFLAGS)