source: vis_dev/vl2mv-2.3/Makefile.in @ 104

Last change on this file since 104 was 18, checked in by cecile, 13 years ago

vl2mv added

File size: 25.3 KB
RevLine 
[18]1# FileName      [ Makefile.in ]
2#
3# PackageName   [ vl2mv ]
4#
5# Synopsis      [ Package-wide Makefile ]
6#
7# Description   [ This file requires GNU's make program.
8#                 Run "configure" to generate the Makefile, or use
9#                 "config.status" (created by configure) to regenerate the
10#                 Makefile after modifying this file.
11#
12#                 Type "gmake help" for help about valid targets.
13#                ]
14#
15# SeeAlso       [ configure.in ]
16#
17# Author        [ Stephen Edwards <sedwards@eecs.berkeley.edu>
18#                 Tom Shiple <shiple@eecs.berkeley.edu> ]
19#
20# Copyright     [
21#  Copyright (c) 1994-1996 The Regents of the Univ. of California.
22#  All rights reserved.
23#
24#  Permission is hereby granted, without written agreement and without license
25#  or royalty fees, to use, copy, modify, and distribute this software and its
26#  documentation for any purpose, provided that the above copyright notice and
27#  the following two paragraphs appear in all copies of this software.
28#
29#  IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
30#  DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
31#  OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
32#  CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33#
34#  THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
35#  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
36#  FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN
37#  "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE
38#  MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
39#  ]
40#
41# Revision      [$Id: Makefile.in,v 1.6 2010/04/10 03:51:10 fabio Exp $]
42
43# Default target:
44
45.PHONY : default
46
47default : all
48
49#----------------------------------------------------------------------
50# The list of packages to compile.  Change this if you are only compiling
51# part of vl2mv
52#----------------------------------------------------------------------
53
54#PKGS = parser
55PKGS = $(ALL_PKGS)
56
57#----------------------------------------------------------------------
58# This Makefile is designed for three different situations:
59#
60# 1. Single platform build (the default)
61#
62#    All packages listed in the PKGS variable
63#    local_srcdir = master_srcdir = .
64#
65# 2. Multi-platform build
66#
67#    All packages listed in the PKGS variable
68#    local_srcdir = master_srcdir = /where/source/files/reside
69#
70# 3. Multi-platform development (used at Berkeley)
71#
72#    Packages under development listed in the PKGS variable
73#    local_srcdir = ../common
74#    master_srcdir = /projects/vis/vis-devel/common
75#
76#    User has a directory structure that looks like
77#
78#       vis/common/src/         Subdirectory with package source files
79#                               under development.
80#
81#       vis/$PLATFORM/          Subdirectory with this Makefile.
82#                               Compilation is invoked here.
83#
84#       $PLATFORM is something like "alpha-g" (DEC Alpha, debug version)
85#
86#----------------------------------------------------------------------
87
88#----------------------------------------------------------------------
89# Information about all the packages
90#----------------------------------------------------------------------
91
92ALL_PKGS = parser set stack
93
94# Generate the list of all packages NOT in the PKGS list
95
96MISSING_PKGS = $(filter-out $(PKGS), $(ALL_PKGS))
97
98#----------------------------------------------------------------------
99# For safety
100#----------------------------------------------------------------------
101
102SHELL = /bin/sh
103.SUFFIXES:
104
105#----------------------------------------------------------------------
106# The name of the product and its version
107#----------------------------------------------------------------------
108
109PRODUCT = vl2mv
110VERSION = 2.3
111
112# Compile and version information
113#
114# CUR_DATE and CUR_VER are strings surrounded by double quotes that contain
115# spaces, e.g., "vl2mv release 3.0"
116
117VERDATE := -DCUR_DATE="\"$(shell date)\"" -DCUR_VER="\"$(PRODUCT) release $(VERSION)\""
118
119#----------------------------------------------------------------------
120# Source directories
121#----------------------------------------------------------------------
122
123# Directory containing master source files.  This directory is searched
124# for packages NOT listed in the PKGS variable.  Defaults to "."
125# Override with  ./configure --srcdir=
126master_srcdir = @srcdir@
127
128# Directory containing local source files.  This directory is searched
129# for packages listed in the PKGS variable.  Defaults to the master source
130# directory (see above).
131# Override with ./configure --with-local-srcdir=
132local_srcdir =  @local_srcdir@
133
134#----------------------------------------------------------------------
135# Directories used while building
136#----------------------------------------------------------------------
137
138# Directories to search for glu .h files (space-separated)
139gluincdir1 =    @gluincdir@
140
141# Directories to search for libglu.a (space-separated)
142glulibdir1 =    @glulibdir@
143
144# Directory where object files will be placed during the build
145objectdir =     obj
146
147# Directory where links to header files will be placed during the build
148headerdir =     $(local_srcdir)/include
149
150# Directories where documentation will be placed during the build
151docdir =        $(master_srcdir)/doc
152htmldocdir =    $(docdir)/html
153txtdocdir =     $(docdir)/txt
154helpdir =       $(master_srcdir)/share/help
155
156# Directories to search for VL2MV library files
157# Set by ./configure --with-vl2mv-libdir=
158vl2mvlibdir =   @vl2mvlibdir@
159
160#----------------------------------------------------------------------
161# Defaults for GLU library and header files
162#----------------------------------------------------------------------
163
164ifndef gluincdir1
165  gluincdir = ../glu-$(VERSION)/include ../../glu-$(VERSION)/include
166else
167  gluincdir = $(gluincdir1)
168endif
169
170ifndef glulibdir1
171  glulibdir = ../glu-$(VERSION) ../../glu-$(VERSION)
172else
173  glulibdir = $(glulibdir1)
174endif
175
176#----------------------------------------------------------------------
177# Installation names and directories
178#----------------------------------------------------------------------
179
180# Name of the library to create
181LIBRARY =       lib$(PRODUCT).a
182
183# Name of the man page
184MANPAGE =       vl2mv.1
185
186# Directory in which to install architecture-independent files
187# Set by ./configure --prefix=...
188prefix =        @prefix@
189
190# Directory in which to install architecture-dependent files
191# Set by ./configure --exec-prefix=...
192exec_prefix =   @exec_prefix@
193
194# Directory in which to install binaries
195bindir =        $(exec_prefix)/bin
196
197# Directory in which to install libraries
198libdir =        $(exec_prefix)/lib
199
200# Directory in which to install headers
201includedir =    $(prefix)/include
202
203# Directory in which to install architecture-independent library files
204datadir =       $(prefix)/share/vl2mv
205
206# Directory for the man page
207mandir = $(prefix)/man/man1
208
209#----------------------------------------------------------------------
210# The following are set by the configure script
211#----------------------------------------------------------------------
212
213AC_FLAGS =      @DEFS@
214LIBDIRS =       @LIBDIRS@
215RANLIB =        @RANLIB@
216CC =            @CC@
217LINKER =        @LINKER@
218LDFLAGS =       @LDFLAGS@
219CFLAGS =        @CFLAGS@
220OTHERLIBS =     @LIBS@ @LEXLIB@
221YACC =          @YACC@
222LEX =           @LEX@
223NAWK =          @AWK@
224SED =           @SED@
225INSTALL =       @INSTALL@
226INSTALL_PROGRAM = @INSTALL_PROGRAM@
227INSTALL_DATA =  @INSTALL_DATA@
228AR =            @AR@
229
230
231#----------------------------------------------------------------------
232# Distributed files in the doc directory
233#----------------------------------------------------------------------
234
235DOCUMENTATION =
236
237#----------------------------------------------------------------------
238# Examples included in the distribution
239#----------------------------------------------------------------------
240
241# The "interesting" example files are anything in the examples subdirectories
242# except the RCS subdirectories
243#
244# This is a rather messy way to look for filenames in the local_srcdir,
245# then remove the local_srcdir prefix
246
247EXAMPLEFILES = $(patsubst $(local_srcdir)/%, %, \
248                $(filter-out %RCS, $(foreach example, $(EXAMPLES), \
249                  $(wildcard $(local_srcdir)/examples/*))))
250
251#----------------------------------------------------------------------
252# Include the make templates from all the packages
253#
254# Each of these templates (e.g., parser/parser.make) should contains lines
255# of the form
256#
257# CSRC += source1.c source2.c
258# HEADERS += header1.h header2.h
259# LEXSRC += file1.l
260# YACCSRC += file2.y
261# GENERATEDCSRC += ctlpLex.c ctlpRead.c
262#----------------------------------------------------------------------
263
264MAKEINCLUDES = $(foreach package, $(PKGS), \
265        $(local_srcdir)/src/$(package)/$(package).make)
266
267include $(MAKEINCLUDES)
268
269OBJECTS = $(addprefix $(objectdir)/,$(GENERATEDCSRC:.c=.o) $(CSRC:.c=.o))
270
271#----------------------------------------------------------------------
272# Include the dependency files from each package directory.
273# A missing dependency file does not produce an error.
274#----------------------------------------------------------------------
275
276DEPENDENCIES = $(foreach package, $(PKGS), \
277        $(local_srcdir)/src/$(package)/$(package).d)
278
279-include $(DEPENDENCIES)
280
281#----------------------------------------------------------------------
282# Header files and library search paths and names
283#
284# INCLUDEDIRS looks like "-I/projects/glu/ -I/projects/vis/ ..."
285# LIBRARYDIRS looks like "-L/projects/glu/ -L/projects/vis/ ..."
286# LIBS looks like "-lm -lglu -lvl2mv"
287#----------------------------------------------------------------------
288
289INCLUDEDIRS = $(addprefix -I,$(gluincdir)) \
290                $(foreach package, $(PKGS), -I$(local_srcdir)/src/$(package)) \
291                $(foreach package, $(MISSING_PKGS), \
292                -I$(master_srcdir)/src/$(package)) \
293                -I$(objectdir)
294
295LIBRARYDIRS = $(addprefix -L,$(vl2mvlibdir)) $(addprefix -L,$(glulibdir)) \
296                $(LIBDIRS)
297
298# Link against the vl2mv library only if some packages are missing
299# (i.e., we are compiling only a few packages locally)
300
301ifneq ($(strip $(MISSING_PKGS)),)
302  VL2MVLIBS = -l$(PRODUCT)
303else
304  VL2MVLIBS =
305endif
306
307GLULIBS = -lglu
308
309LIBS = $(VL2MVLIBS) $(GLULIBS) $(OTHERLIBS)
310
311#----------------------------------------------------------------------
312# Form the the list of directories to search for header files.
313#
314# VPATH looks like /projects/vis:/projects/glu/: ...
315#----------------------------------------------------------------------
316
317VPATH = $(local_srcdir): \
318        $(master_srcdir): \
319        $(addprefix :$(local_srcdir)/src/,$(PKGS)): \
320        $(addprefix :$(master_srcdir)/src/,$(MISSING_PKGS)): \
321        $(objectdir)
322
323#----------------------------------------------------------------------
324# Definitions for the distribution file
325#----------------------------------------------------------------------
326
327DISTRIBUTION = $(PRODUCT)-$(VERSION)
328
329# Directories to include in the distribution file
330
331DISTDIRS = src helpers obj doc examples $(addprefix src/,$(PKGS))
332
333# Build/install helper files
334
335HELPERS = $(addprefix helpers/, \
336        install-sh mkinstalldirs config.guess config.sub dependency.make)
337
338# Files to include in the distribution file
339
340DISTFILES = \
341        README INSTALL NEWS \
342        configure configure.in Makefile.in $(HELPERS) \
343        vl2mv.1 \
344        $(CSRC) $(HEADERS) $(LEXSRC) $(YACCSRC) $(MAKEINCLUDES) \
345        $(EXAMPLEFILES) \
346        $(addprefix doc/,$(DOCUMENTATION))
347
348#----------------------------------------------------------------------
349# Implicit rules
350#----------------------------------------------------------------------
351
352ALLCFLAGS = $(CFLAGS) $(AC_FLAGS) $(VERDATE) \
353                -DNAWK=\"$(NAWK)\" -DLIBRARY=\"$(datadir)\"
354
355# For compiling a source file into the object directory
356
357$(objectdir)/%.o : %.c
358        umask 2 ; $(CC) -c $(ALLCFLAGS) $(INCLUDEDIRS) -o $@ $<
359
360# Place object files into an archive
361
362%.a :
363        rm -f $@
364        umask 2; $(AR) cq $@ $^
365        $(RANLIB) $@
366
367######################################################################
368#                               RULES                                #
369######################################################################
370
371#:
372#: Useful targets:
373#:
374
375#----------------------------------------------------------------------
376# Rule for getting help
377#----------------------------------------------------------------------
378
379.PHONY : help
380
381#: help -- Print a list of targets
382
383# This prints all lines in this Makefile that begin with #:
384
385help :
386        @sed -n "s/^#://p" Makefile
387
388#----------------------------------------------------------------------
389# Always executed once when the Makefile is run
390#----------------------------------------------------------------------
391
392# Make sure the directory in which to place the objects exists
393
394ignored := $(shell umask 2; test -d $(objectdir) || mkdir $(objectdir))
395
396#----------------------------------------------------------------------
397# Rules to compile and build libraries and executables
398#----------------------------------------------------------------------
399
400#.PHONY : all library compile-version delete-version
401.PHONY : all library
402
403#:
404#: all (the default) -- Compile the main executable
405# (force the version to be recompiled)
406
407#all : compile-version $(PRODUCT)
408all : $(PRODUCT)
409
410# Create the main executable
411
412$(PRODUCT) : $(OBJECTS) $(glulibdir)/libglu.a
413        umask 2 ; $(LINKER) -o $(PRODUCT) $(LDFLAGS) \
414                $(OBJECTS) $(LIBRARYDIRS) $(LIBS)
415
416# Force the "version" information to be recompiled
417
418compile-version : delete-version $(objectdir)/vmVers.o
419
420# Delete the object file related to the version
421
422delete-version :
423        rm -f $(objectdir)/vmVers.o
424
425# Build a library containing all the objects
426
427#: library -- Create a library of all the objects (useful in a central area)
428
429library : $(LIBRARY)
430
431$(LIBRARY) : $(OBJECTS)
432
433
434#----------------------------------------------------------------------
435# Rules for installation
436#----------------------------------------------------------------------
437
438.PHONY : install uninstall installdirs
439
440#:
441#: install -- Install the product and libraries in bindir, libdir,
442#:            datadir, etc.
443
444install : $(PRODUCT) $(LIBRARY) installdirs
445        @echo "Installing $(bindir)/$(PRODUCT)"
446        @$(INSTALL_PROGRAM) $(PRODUCT) $(bindir)/$(PRODUCT)
447        @echo "Installing $(libdir)/$(LIBRARY)"
448        @$(INSTALL_DATA) $(LIBRARY) $(libdir)/$(LIBRARY)
449        @echo "Installing $(mandir)/vl2mv.1"
450        @$(INSTALL_DATA) vl2mv.1 $(mandir)/vl2mv.1
451        @for header in $(HEADERS); do \
452                echo "Installing $(includedir)/$$header"; \
453                $(INSTALL_DATA) $(master_srcdir)/src/*/$$header \
454                        $(includedir)/$$header; \
455        done
456
457#: uninstall -- Reverse the effects of "install"
458
459uninstall :
460        rm -f $(bindir)/$(PRODUCT)
461        rm -f $(libdir)/$(LIBRARY)
462        @for header in $(HEADERS); \
463        do \
464          echo "Removing $(includedir)/$$header"; \
465          rm -f $(includedir)/$$header; \
466        done
467
468installdirs :
469        $(master_srcdir)/helpers/mkinstalldirs \
470                $(bindir) $(libdir) $(includedir) $(datadir) $(datadir)/help \
471                $(mandir)
472
473#----------------------------------------------------------------------
474# Rules for checking the build
475#----------------------------------------------------------------------
476
477.PHONY : check
478
479# Determine the absolute executable path
480#
481# Starting from the current directory, change directory to the directory
482# part of the product name, then tack on the filename part of EXECUTABLE
483
484EXECUTABLE = $(PRODUCT)
485
486EXECUTABLEPATH := \
487        $(shell cd $(dir $(EXECUTABLE)) ; pwd)/$(notdir $(EXECUTABLE))
488
489# Determine the rootname of the examples
490
491EXAMPLEPATH = $(master_srcdir)/examples
492
493FULLEXAMPLEPATH := $(shell cd $(EXAMPLEPATH) ; pwd)
494
495# list of all examples to check
496
497EXAMPLES = ABypassCtrl ABypassSpec AdecSE1 BBypassSpec \
498Bcc BdecSE1 FIFOs FPMult FPMultLTL1 IFetchControl IFetchControl1 IntArith \
499IntLogic Jmp Mem PI_BUS PPC60X_bus abp abstr_fabr_4cycle am2901 am2910 amp \
500arbiter arbiter_bug arbiter_le atom_bakery bak_otLTLM1 bak_otLTLM2 \
501bak_otLTLM3 bak_otLTLM4 bak_otLTLM5 bakery bakery_ot ball barrel4 bcuvis32 biu\
502bpbs buf_bug  bufferAlloc bug checkers coherence controlvis counter \
503cp0IntEncoder cp0control crd ctlp3 ctlp3LTLM1 ctlp3LTLM2 ctlp3LTLM3 \
504daio_receiver dcnew drop4 eisenberg eisenbergLTLM1 eisenbergLTLM2 eleLTLM1 \
505ely1-3 ely2-3 ely2-4 ely3-4 ethernet.define.112 ethernet.define.212 \
506ethernet.define.312 ethernet.define.412 exampleS extIntControl fabric_beh \
507fabric_str freecell fru32 ftxr fysel8x8 gcd gcdLTL2 gigamax good_bakery gray \
508hwb30 ibuf ibuf_ctl ic_cntl icctl icctl_env idu32 island jam ldStoCtrl.save \
509ldStoCtrl lock luckySeven luckySevenONE matrix matrix_bug minMax mppLTLM1 \
510network nosel nullModem nullModemLTL1 nullmodemLTLM1 packstart palu paluLTL1 \
511parsepack parsesys pcuv peterson pf philo philo4 ping_pong_new prodcell \
512prodcellLTL2 rcnum rcnum16 rcnum25 rcv relinit reqAck reqAckRed reset rgraph \
513rotate32 rotate4 scheduler segf1 sfeistel sg1 shampoo short slider snd soap \
514soapLTL1 soapLTL3 soapLTL4 soapLTLM1 soapLTLM2 soapLTLM3 solitaireVL \
515spinner32 spinner4 spm starving_bakery storeBufferCtrl syncarb synch_bakery \
516tcp test three_processor ticTacToe tlbControl tlc two twoAll twoFifo1 twoQ \
517two_processor twoqLTLM1 twoqLTLM2 vMiim vcordic vcrc32_8 vending vlunc \
518vsa16a vsaR wallace8
519
520#:
521#: check -- Test the locally-built executable (runs check-examples)
522
523#:          Test each of the examples listed in CHECK_EXAMPLES
524#:          You may want to invoke this with
525#:            gmake "CHECK_EXAMPLES=abp bakery" check-examples
526#:            gmake EXECUTABLE=vis-cmu check-examples
527#:            gmake EXECUTABLE=/projects/vis/vis-devel/alpha-g/vis \
528#:                    check-examples
529#:            gmake EXAMPLEPATH=/projects/vis/vis-devel/common/examples \
530#:                    check-examples
531#:            gmake EXAMPLEPATH=../common/examples check-examples
532#:            gmake VIS_LIBRARY_PATH=/projects/vis/vis-devel/share
533
534# For each example,
535#
536# 1) create the directory checkresults/<example>
537# 2) enter that directory
538# 3) create "check_script" by prepending a "set open_path" command
539#    to the example's check_script in the master source directory.  This
540#    makes VIS look in the master source directory for example files
541# 4) run VIS on that script, producing "result.raw"
542# 5) filter out relevant lines in the result, producing "result.filtered"
543#    and compare this with the "check_result" file in the master source
544#    directory.  Differences are written to "result.differences"
545
546check :
547        @test -d checkresults || mkdir checkresults
548        @echo "Checking examples.  Results will be in checkresults/<example>/result.raw"
549        @echo "Running executable $(EXECUTABLEPATH)"
550        @echo " (change with EXECUTABLE=...)"
551        @echo "Taking examples from $(FULLEXAMPLEPATH)"
552        @echo " (change with EXAMPLEPATH=...)"
553        @here=`pwd`  ; \
554        for example in $(EXAMPLES) ; \
555        do \
556          cd $(FULLEXAMPLEPATH) ; \
557          echo -n "Checking $$example ... " ; \
558          test -d $$here/checkresults/$$example \
559            || mkdir $$here/checkresults/$$example ; \
560          $(EXECUTABLEPATH) $$example.v -o $$here/checkresults/$$example/$$example.mv >$$here/checkresults/$$example/result.out 2>$$here/checkresults/$$example/result.err ; \
561          cat $$here/checkresults/$$example/result.err >> \
562            $$here/checkresults/$$example/result.out ; \
563          rm  $$here/checkresults/$$example/result.err ; \
564          if egrep -v "\.v$$|uninitialize" $$here/checkresults/$$example/result.out ;\
565          then \
566            echo "failed (more checkresults/$$example/result.out)" ; \
567          else \
568            echo "passed" ; \
569          fi ; \
570        done
571
572#----------------------------------------------------------------------
573# Rules that produce/delete the dependency file for every package
574#----------------------------------------------------------------------
575
576.PHONY : dependencies cleandependencies
577
578#:
579#: dependencies -- Create a list of dependency files.
580#:                 Useful when modifying header files.
581
582# Invoke the "dependency.make" Makefile on each package subdirectory,
583# passing the path, etc. to it.
584#
585# There's a strange feature in autoconf where lines of the form " VPATH="
586# are removed from the Makefile.  Thus, a flag is placed before the
587# VPATH= argument below.
588
589dependencies:
590ifeq ($(CC),gcc)
591        for pkg in $(PKGS) ; \
592        do \
593          $(MAKE) --no-print-directory \
594                -f $(master_srcdir)/helpers/dependency.make \
595                CC="$(CC)" \
596                CFLAGS="$(CFLAGS)" VPATH="$(local_srcdir)/src/$$pkg" \
597                AC_FLAGS="$(AC_FLAGS)" \
598                INCLUDEDIRS="$(INCLUDEDIRS)" objectdir=$(objectdir) \
599                PKGNAME=$(local_srcdir)/src/$$pkg/$$pkg \
600                $(local_srcdir)/src/$$pkg/$$pkg.d ; \
601        done
602else
603        @echo "dependency requires gcc"
604        @echo "Reconfigure with gcc"
605endif
606
607cleandependencies:
608        rm -f $(local_srcdir)/src/*/*.d
609
610#----------------------------------------------------------------------
611# Rules for making a distribution file
612#----------------------------------------------------------------------
613
614.PHONY : dist
615
616#:
617#: dist -- Create a tarred, gzipped distribution file
618
619# Warning: "tar" under Digital Unix (on DEC Alphas) writes directories
620# that don't work under SunOS tar
621
622dist : $(DISTRIBUTION).tar.gz
623
624$(DISTRIBUTION).tar.gz : $(DISTFILES)
625ifeq ($(strip $(FULL_MISSING_PKGS)),)
626        rm -rf $(DISTRIBUTION)
627        umask 022; mkdir $(DISTRIBUTION)
628        for dir in $(DISTDIRS); \
629        do \
630          umask 022; mkdir $(DISTRIBUTION)/$$dir; \
631        done
632        @echo "Copying distribution files"
633        @for file in $(patsubst $(local_srcdir)/%, %, $^); \
634        do \
635          echo "  $$file"; \
636          cp -p $(local_srcdir)/$$file $(DISTRIBUTION)/$$file; \
637        done
638        - chmod -R a+r $(DISTRIBUTION)
639        - chmod -R u+w $(DISTRIBUTION)
640        tar cf - $(DISTRIBUTION) | gzip > $(DISTRIBUTION).tar.gz
641        rm -rf $(DISTRIBUTION)
642else
643        @echo "Missing packages: $(FULL_MISSING_PKGS)"
644        @echo "Make sure PKGS lists all the packages"
645        @exit 1
646endif
647
648#----------------------------------------------------------------------
649# Rules for rebuilding the configure file and Makefile
650#----------------------------------------------------------------------
651
652${master_srcdir}/configure : configure.in
653        cd ${master_srcdir} && autoconf
654        chmod 0775 ${master_srcdir}/config*
655
656config.status : configure
657        ./config.status --recheck
658
659Makefile : Makefile.in config.status
660        @echo "The master Makefile.in has been changed:"
661        @echo "run config.status"
662        @echo "Warning: This will overwrite any local Makefile modifications"
663        @exit 1
664
665#----------------------------------------------------------------------
666# Rules for cleaning
667#----------------------------------------------------------------------
668
669.PHONY : clean mostlyclean distclean
670
671#:
672#: clean -- Remove every file created by building
673
674clean mostlyclean :
675        rm -rf $(objectdir)/* $(LIBRARY) $(PRODUCT) \
676                $(foreach bddpkg, $(BDDPKGS), $(PRODUCT)-$(bddpkg)) \
677                checkresults include
678
679#: distclean -- Remove every file created by building or configuring
680
681distclean : clean cleandependencies
682        rm -f Makefile config.status config.cache config.log
683
684#----------------------------------------------------------------------
685# Rule for performing a lint-like check on the source code
686#
687# Note: This requires gcc
688#----------------------------------------------------------------------
689
690.PHONY : check-code
691
692#:
693#: check-code -- Run a lint-like check on the source code.
694#:               (useful for development)
695
696check-code : $(CSRC) $(BDD_CSRC) $(MDD_CSRC)
697ifeq ($(CC),gcc)
698        @rm -f *.o_checkcode
699        @for file in $^; \
700        do \
701          echo "------------------------ Checking $$file"; \
702          gcc -c $(CFLAGS) $(AC_FLAGS) $(VERDATE) $(INCLUDEDIRS) \
703                -Wall -Wno-comment -o $(objectdir)/checkcode_output.o $$file; \
704          rm -f $(objectdir)/checkcode_output.o; \
705        done
706        @rm -f *.o_checkcode
707else
708        @echo "check-code requires gcc"
709        @echo "Reconfigure with gcc"
710endif
711
712#----------------------------------------------------------------------
713# Rule for generating function prototypes for all the
714# source and header files in all the PKGS
715#
716# Note: This requires "extproto," part of the ext package available from
717# ftp://ic.eecs.berkeley.edu/pub/Ext
718#----------------------------------------------------------------------
719
720.PHONY : proto
721
722#:
723#: proto -- Regenerate all the function prototypes in the packages
724#:          Useful during development.  You may want to invoke it with
725#:            gmake "PKGS=tst tbl" proto
726
727proto :
728        @cd $(local_srcdir)/src ; \
729        for pkg in $(PKGS); \
730        do \
731          cd $$pkg ; \
732          extproto *.h *.c ; \
733          cd .. ; \
734        done
735
736#----------------------------------------------------------------------
737# Rules for generating the documentation and command help files
738# for all the packages
739#
740# Note: This requires "extdoc," part of the ext package, and
741# lynx, a textual WWW browser
742#----------------------------------------------------------------------
743
744.PHONY : allDoc doc indices helpfiles cleandoc
745
746#:
747#: allDoc -- Extract all the documentation (runs doc, indices, and helpfiles)
748
749allDoc : cleandoc doc indices helpfiles
750
751#: doc -- Extract HTML and text documentation on all the functions
752
753doc : $(htmldocdir) $(txtdocdir)
754        for pkg in $(PKGS); \
755        do \
756          umask 2 ; extdoc --html=$(htmldocdir) --text=$(txtdocdir) \
757                $(local_srcdir)/src/$$pkg/$$pkg; \
758        done
759
760#: indices -- Generate function and command indices for the HTML documentation
761
762indices : $(htmldocdir)
763        umask 2 ; extindex $(htmldocdir)
764
765#: helpfiles -- Generate the help files from the HTML documentation
766
767helpfiles : $(helpdir)
768        for file in $(htmldocdir)/*Cmd.html ; \
769        do \
770          echo Converting $$file ; \
771          umask 2 ; lynx -dump $$file > $(helpdir)/`basename $$file .html`.txt ; \
772        done
773
774#: cleandoc -- Remove all the documentation generated by "allDoc"
775
776cleandoc :
777        -rm -f $(htmldocdir)/*.html
778        -rm -f $(txtdocdir)/*.txt
779        -rm -f $(helpdir)/*Cmd.txt
780
781$(htmldocdir) :
782        - umask 2 ; mkdir $(htmldocdir)
783
784$(txtdocdir) :
785        - umask 2 ; mkdir $(txtdocdir)
786
787$(helpdir) :
788        - umask 2 ; mkdir $(helpdir)
789
790
791
792#----------------------------------------------------------------------
793# Rules for debugging the Makefile
794#----------------------------------------------------------------------
795
796.PHONY : debug-make
797
798DEBUG_VARS =    ALL_PKGS \
799                PKGS \
800                MISSING_PKGS \
801                VPATH \
802                INCLUDEDIRS \
803                CSRC \
804                OBJECTS \
805                HEADERS \
806                MAKEINCLUDES \
807                CFLAGS \
808                AC_FLAGS \
809                master_srcdir \
810                local_srcdir \
811                RCSFILES \
812                RCSDIR \
813                LIBS \
814                VL2MVIBS \
815                DISTFILES \
816                EXAMPLEFILES
817
818#:
819#: debug-make -- Print a list of Makefile variables
820
821debug-make:
822        @$(foreach var, $(DEBUG_VARS), echo $(var)=$($(var)) ; )
Note: See TracBrowser for help on using the repository browser.