1 # Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = dejagnu
5 # Install all the associated data files
6 SUBDIRS = doc # testsuite example
8 # Install the bourne shell script driver in the bindir
11 # Install the main DejaGnu expect file in the datadir
12 pkgdata_SCRIPTS = runtest.exp
14 # Install config.guess too, so we can use it to figure out what type
15 # of machine we're running on.
16 libexecdir = $(pkgdatadir)/libexec
17 libexec_SCRIPTS = config.guess
19 DATE = `date "+%Y%m%d`
24 RUNTESTDEFAULTFLAGS = --srcdir $(srcdir)/testsuite RUNTEST=$(RUNTEST)
26 if [ -f ${srcdir}/runtest$(EXEEXT) ] ; then \
27 echo ${srcdir}/runtest$(EXEEXT); \
28 else echo "ERROR: runtest not found" ; exit 1; fi`
30 CLEANFILES = x.log x.sum site.bak setval.tmp
32 cd testsuite ; $(MAKE) check
33 cd example ; $(MAKE) check
35 # Since we don't use SUBDIRS, we have to manually clean the
36 # subdirectories. We don't use SUBDIRS, so the example or test cases
37 # don't get built by default for a "make all".
39 cd doc ; $(MAKE) clean
40 cd testsuite ; $(MAKE) clean
41 cd example ; $(MAKE) clean
43 # Set ourselves up to build an RPM
44 tarball: book1.html overview.ps overview.pdf
45 -rm -fr dejagnu-${VERSION}
46 cp -fpPR $(srcdir) dejagnu-${VERSION}
48 dir=`(cd $${src}; pwd)`; \
49 (cd dejagnu-${VERSION} ; $${dir}/Clean.tcl); \
50 cp -R $(srcdir)/doc/html dejagnu-${VERSION}/doc/; \
51 cp $(srcdir)/doc/overview.ps dejagnu-${VERSION}/doc/; \
52 cp $(srcdir)/doc/overview.pdf dejagnu-${VERSION}/doc/; \
53 cp $(srcdir)/doc/overview.rtf dejagnu-${VERSION}/doc/; \
54 tar cvf ../dejagnu-${VERSION}.tar dejagnu-${VERSION}; \
55 gzip -9fv ../dejagnu-${VERSION}.tar
57 rpmspec: $(srcdir)/packaging/rpm/dejagnu.spec
58 cp -f $(srcdir)/packaging/rpm/dejagnu.spec /usr/src/redhat/SPECS/
60 # Build an RPM package
62 cp -f ../dejagnu-${VERSION}.tar.gz /usr/src/redhat/SOURCES/
63 rpm -ba /usr/src/redhat/SPECS/dejagnu.spec
65 # Build a Debian deb package
66 deb: book1.html overview.ps overview.pdf
67 -rm -fr dejagnu-${VERSION}
68 cp -fpr $(srcdir) dejagnu-${VERSION}
69 @echo "clean up stuff we don't want in the source file"
71 dir=`(cd $${src}; pwd)`; \
72 (cd dejagnu-${VERSION} ; $${dir}/Clean.tcl);
74 -cp -fr $(srcdir)/packaging/deb dejagnu-${VERSION}/
75 -cp -fr doc/html dejagnu-${VERSION}/doc/;
76 -cp -fr doc/overview.ps dejagnu-${VERSION}/doc/;
77 -cp -fr doc/overview.pdf dejagnu-${VERSION}/doc/;
78 -cp -fr doc/overview.rtf dejagnu-${VERSION}/doc/;
79 (cd dejagnu-${VERSION}; dpkg-buildpackage)
81 # Build a Solaris package
82 solpkg: $(srcdir)/packaging/pkg/prototype
83 if test ! -d $(PKGDIR)/dejagnu; then \
84 rm -fr dejagnu-${VERSION}; \
85 mkdir dejagnu-${VERSION}; \
86 cd dejagnu-${VERSION}; \
87 $(srcdir)/configure -v --prefix $(PKGDIR)/dejagnu; \
90 cp $(srcdir)/packaging/pkg/prototype /tmp
91 cp $(srcdir)/packaging/pkg/pkginfo /tmp
94 pkgmk -o -r / -d /tmp; \
95 tar cf $$here/dejagnu-${VERSION}.SPARC.2.8.pkg.tar DejaGnu; \
96 gzip -9fv $$here/dejagnu-${VERSION}.SPARC.2.8.pkg.tar
97 rm -fr /tmp/prototype /tmp/pkginfo /tmp/DejaGnu
99 # Build a HP depot package
100 hpdepot: # $(srcdir)/packaging/depot/dejagnu.psf
101 if test ! -d $(PKGDIR)/dejagnu; then \
102 rm -fr dejagnu-${VERSION}; \
103 mkdir dejagnu-${VERSION}; \
104 cd dejagnu-${VERSION}; \
105 $(srcdir)/configure -v --prefix $(PKGDIR)/dejagnu; \
108 swpackage -s $(srcdir)/packaging/depot/dejagnu.psf -x target_type=directory -d /tmp
111 tar cf $$here/dejagnu-${VERSION}.hpux11.depot dejagnu; \
112 gzip -9fv $$here/dejagnu-${VERSION}.hpux11.depot; \
115 book1.html overview.ps overview.pdf install-doc:
116 cd doc && $(MAKE) $(FLAGS_TO_PASS) $@
118 # Automake sucks when it comes to building a distribution, so
119 # we just copy the source tree onto of what Automake did, and
120 # then we Clean it. Automake only includes the source files.
121 # We want all the testsuites, data files, and html versions of the doc.
122 dist-hook: rpmspec book1.html overview.ps overview.pdf
124 cp -fpr $(srcdir) $(distdir)
125 (cd $(distdir) ; $(TCLSH) $(srcdir)/Clean.tcl)
126 -cp -fr doc/html $(distdir)/doc/
127 -cp -fr doc/overview.ps $(distdir)/doc/
128 -cp -fr doc/overview.pdf $(distdir)/doc/
130 # Below, host-independent data files that need to get installed.
131 # We do it this way so we can use globbing.
133 lib_dest = $(DESTDIR)$(pkgdatadir)
134 lib_files = $(srcdir)/*.c $(srcdir)/lib/*.exp
136 baseboards_dest = $(DESTDIR)$(pkgdatadir)/baseboards
137 baseboards_files = $(srcdir)/baseboards/README $(srcdir)/baseboards/*.exp
139 include_dest = $(DESTDIR)$(includedir)
140 config_dest = $(DESTDIR)$(pkgdatadir)/config
141 config_files = $(srcdir)/config/README $(srcdir)/config/*.exp
144 $(mkinstalldirs) $(lib_dest) $(include_dest)
145 for f in $(lib_files); do \
146 test ! -f "$$f" || $(INSTALL_DATA) $$f $(lib_dest); \
148 $(mkinstalldirs) $(baseboards_dest)
149 for f in $(baseboards_files); do \
150 test ! -f "$$f" || $(INSTALL_DATA) $$f $(baseboards_dest); \
152 $(INSTALL_DATA) $(srcdir)/dejagnu.h $(include_dest); \
153 $(mkinstalldirs) $(config_dest)
154 for f in $(config_files); do \
155 test ! -f "$$f" || $(INSTALL_DATA) $$f $(config_dest); \
159 for f in $(lib_files); do \
160 test ! -f "$$f" || rm -f $(lib_dest)/`basename "$$f"`; \
162 for f in $(config_files); do \
163 test ! -f "$$f" || rm -f $(config_dest)/`basename "$$f"`; \
165 for f in $(baseboards_files); do \
166 test ! -f "$$f" || rm -f $(baseboards_dest)/`basename "$$f"`; \
169 for f in $(baseboards_files); do \
170 test ! -f "$$f" || rm -f $(baseboards_dest)/`basename "$$f"`; \
172 rm -f $(include_dest)/dejagnu.h;
175 @echo 'Making a new site.exp file...'
176 @test ! -f site.bak || rm -f site.bak
177 @echo '## these variables are automatically generated by make ##' > $@-t
178 @echo '# Do not edit here. If you wish to override these values' >> $-t
179 @echo '# edit the last section' >> $@-t
180 @echo 'set srcdir $(srcdir)' >> $@-t
181 @echo 'set objdir' `pwd` >> $@-t
182 @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
183 @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
184 @test ! -f site.exp || mv site.exp site.bak