-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.in
More file actions
796 lines (632 loc) · 23.6 KB
/
Copy pathMakefile.in
File metadata and controls
796 lines (632 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
# FileName [ Makefile.in ]
#
# PackageName [ glu ]
#
# Synopsis [ Package-wide Makefile ]
#
# Description [ This file requires GNU's make program.
# Run "configure" to generate the Makefile, or use
# "config.status" (created by configure) to regenerate the
# Makefile after modifying this file.
#
# Type "gmake help" for a list of valid targets. ]
#
# SeeAlso [ configure.in ]
#
# Author [ Stephen Edwards <sedwards@eecs.berkeley.edu> ]
#
# Copyright [
# Copyright (c) 1994-1998 The Regents of the Univ. of California.
# All rights reserved.
#
# Permission is hereby granted, without written agreement and without license
# or royalty fees, to use, copy, modify, and distribute this software and its
# documentation for any purpose, provided that the above copyright notice and
# the following two paragraphs appear in all copies of this software.
#
# IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
# OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
# CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
# "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE
# MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
# ]
#
# Revision [$Id: Makefile.in,v 1.64 2012/01/31 21:44:36 fabio Exp $]
# Default target:
.PHONY : default
default : all
#----------------------------------------------------------------------
# Lists of packages to compile. Change this if you are only compiling
# part of GLU
#----------------------------------------------------------------------
#PKGS = array
PKGS = $(ALL_BASIC_PKGS)
#BDD_PKGS = cmu
BDD_PKGS = $(ALL_BDD_PKGS)
#MDD_PKGS =
MDD_PKGS = $(ALL_MDD_PKGS)
#----------------------------------------------------------------------
# This Makefile is designed for three different situations:
#
# 1. Single platform build (the default)
#
# All packages listed in the PKGS variable
# local_srcdir = master_srcdir = .
#
# 2. Multi-platform build
#
# All packages listed in the PKGS variable
# local_srcdir = master_srcdir = /where/source/files/reside
#
# 3. Multi-platform development (used at Berkeley)
#
# Packages under development listed in the PKGS variable
# local_srcdir = ../common
# master_srcdir = /projects/glu/glu-devel/common
#
# User has a directory structure that looks like
#
# glu/common/src/ Subdirectory with package source files
# under development.
#
# glu/$PLATFORM/ Subdirectory with this Makefile.
# Compilation is invoked here.
#
# $PLATFORM is something like "alpha-g" (DEC Alpha, debug version)
#
#----------------------------------------------------------------------
#----------------------------------------------------------------------
# Information about all the packages
#----------------------------------------------------------------------
# Note: To add another BDD package, add it to this list and add a rule
# of the form libbdd.a (see the existing ones for an example)
ALL_BASIC_PKGS = array avl bdd epd error graph heap list mem mtr sparse st \
util var_set
ALL_BDD_PKGS = cal cu cmu
ALL_MDD_PKGS = mdd
# Generate the list of all packages NOT in the PKGS list
MISSING_PKGS = $(filter-out $(PKGS), $(ALL_BASIC_PKGS))
MISSING_BDD_PKGS = $(filter-out $(BDD_PKGS), $(ALL_BDD_PKGS))
MISSING_MDD_PKGS = $(filter-out $(MDD_PKGS), $(ALL_MDD_PKGS))
FULL_PKGS = $(PKGS) $(foreach bdd, $(BDD_PKGS), $(bdd)Bdd $(bdd)Port) \
$(MDD_PKGS)
FULL_MISSING_PKGS = $(MISSING_PKGS) \
$(foreach bdd, $(MISSING_BDD_PKGS), $(bdd)Bdd $(bdd)Port) \
$(MISSING_MDD_PKGS)
#----------------------------------------------------------------------
# For safety
#----------------------------------------------------------------------
SHELL = /bin/sh
.SUFFIXES:
#----------------------------------------------------------------------
# The name of the product and its version
#----------------------------------------------------------------------
PRODUCT = glu
VERSION = 2.4
#----------------------------------------------------------------------
# Source directories
#----------------------------------------------------------------------
# Directory containing master source files. This directory is searched
# for packages NOT listed in the PKGS variable. Defaults to "."
# Override with ./configure --srcdir=
master_srcdir = @srcdir@
# Directory containing local source files. This directory is searched
# for packages listed in the PKGS variable. Defaults to the master source
# directory (see above).
# Override with ./configure --with-local-srcdir=
local_srcdir = @local_srcdir@
#----------------------------------------------------------------------
# Directories used while building
#----------------------------------------------------------------------
# Directory where object files will be placed during the build
objectdir = obj
# Directory where links to header files will be placed during the build
headerdir = $(local_srcdir)/include
#----------------------------------------------------------------------
# Installation names and directories
#----------------------------------------------------------------------
# Name of the library to create
LIBRARY = lib$(PRODUCT).a
# Names of the BDD libraries to create
BDD_LIBRARIES = $(foreach bdd, $(BDD_PKGS), lib$(bdd).a)
# Directory in which to install architecture-independent files
# Set by ./configure --prefix=...
prefix = @prefix@
# Directory in which to install architecture-dependent files
# Set by ./configure --exec-prefix=...
exec_prefix = @exec_prefix@
# Directory in which to install libraries
libdir = $(exec_prefix)/lib
# Directory in which to install headers
includedir = $(prefix)/include
#----------------------------------------------------------------------
# The following are set by the configure script
#----------------------------------------------------------------------
AC_FLAGS = @DEFS@
RANLIB = @RANLIB@
AR = @AR@
CC = @CC@
CFLAGS = @CFLAGS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
#----------------------------------------------------------------------
# Include the make templates from all the packages
#
# Each of these templates (e.g., array/array.make) should contains lines
# of the form
#
# CSRC += source1.c source2.c
# HEADERS += header1.h header2.h
# MISC += misc1 misc2
#
# For BDD packages (both Port and Bdd), these should be, e.g.,
#
# CSRC_cmu += source1.c source2.c
# HEADERS_cmu += header1.h
#
# For the MDD package the definition is
#
# CSRC_mdd = source1.c source2.c
# HEADERS_mdd = header1.h
# MISC += misc1 misc2
#----------------------------------------------------------------------
MAKEINCLUDES = \
$(foreach package, $(FULL_PKGS), \
$(local_srcdir)/src/$(package)/$(package).make )
include $(MAKEINCLUDES)
OBJECTS = $(addprefix $(objectdir)/,$(CSRC:.c=.o))
# Collect the names of all the bdd package source files
BDD_CSRC = $(foreach bdd_package, $(BDD_PKGS), $(CSRC_$(bdd_package)))
BDD_HEADERS = $(foreach bdd_package, $(BDD_PKGS), $(HEADERS_$(bdd_package)))
BDD_OBJECTS = $(addprefix $(objectdir)/,$(BDD_CSRC:.c=.o))
CAL_OBJECTS = $(addprefix $(objectdir)/,$(CSRC_cal:.c=.o))
CMU_OBJECTS = $(addprefix $(objectdir)/,$(CSRC_cmu:.c=.o))
CU_OBJECTS = $(addprefix $(objectdir)/,$(CSRC_cu:.c=.o))
# Save the names of the mdd package source files
MDD_CSRC = $(CSRC_mdd)
MDD_HEADERS = $(HEADERS_mdd) $(BDD_HEADERS)
MDD_OBJECTS = $(addprefix $(objectdir)/,$(CSRC_mdd:.c=.o))
#----------------------------------------------------------------------
# Include the dependency files from each package directory.
# A missing dependency file does not produce an error.
#----------------------------------------------------------------------
DEPENDENCIES = $(foreach package, $(PKGS) $(MDD_PKGS) \
$(foreach bdd, $(BDD_PKGS), $(bdd)Bdd $(bdd)Port), \
$(local_srcdir)/src/$(package)/$(package).d)
-include $(DEPENDENCIES)
#----------------------------------------------------------------------
# Form the the list of directories to search for header files.
#
# INCLUDEDIRS looks like "-I/projects/glu/ -I/projects/vis/ ..."
#----------------------------------------------------------------------
INCLUDEDIRS = \
$(foreach package, $(FULL_PKGS), \
-I$(local_srcdir)/src/$(package) ) \
$(foreach package, $(FULL_MISSING_PKGS), \
-I$(master_srcdir)/src/$(package) ) \
-I$(objectdir)
#----------------------------------------------------------------------
# Form the list of directories to search for files listed in make rules.
#
# VPATH looks like /projects/vis:/projects/glu/: ...
#----------------------------------------------------------------------
VPATH = $(local_srcdir): \
$(master_srcdir): \
$(addprefix :$(local_srcdir)/src/,$(FULL_PKGS)): \
$(addprefix :$(master_srcdir)/src/,$(FULL_MISSING_PKGS)): \
$(objectdir)
#----------------------------------------------------------------------
# Definitions for the distribution file
#----------------------------------------------------------------------
DISTRIBUTION = $(PRODUCT)-$(VERSION)
# Directories to include in the distribution file
DISTDIRS = src obj $(addprefix src/,$(FULL_PKGS)) src/cuBdd/doc \
helpers src/cuBdd/doc/icons
# Build/install helper files
HELPERS = $(addprefix helpers/, \
install-sh mkinstalldirs config.guess config.sub dependency.make)
# Files to include in the distribution file
DISTFILES = \
README INSTALL NEWS \
configure configure.in Makefile.in $(HELPERS) \
$(CSRC) $(BDD_CSRC) $(MDD_CSRC) $(HEADERS) $(BDD_HEADERS) \
$(MDD_HEADERS) $(MAKEINCLUDES) \
$(MISC)
#----------------------------------------------------------------------
# Variables used by for Revision Control
#----------------------------------------------------------------------
# The root RCS directory
rcs_rootdir = /projects/glu/rcsRoot/common
RCSFILES = $(CSRC) $(BDD_CSRC) $(MDD_CSRC) $(HEADERS) $(BDD_HEADERS) \
$(MDD_HEADERS) $(MISC) $(MAKEINCLUDES)
RCSMISCFILES = README INSTALL NEWS Makefile.in configure.in localconfigure \
masterconfigure $(HELPERS)
#----------------------------------------------------------------------
# Implicit rules for compiling and archiving
#----------------------------------------------------------------------
# For compiling a source file into the object directory
$(objectdir)/%.o : %.c
umask 2; $(CC) -c $(CFLAGS) $(AC_FLAGS) $(INCLUDEDIRS) -o $@ $<
# Place object files into an archive
%.a :
rm -f $@
umask 2; $(AR) cq $@ $^
$(RANLIB) $@
######################################################################
# RULES #
######################################################################
#:
#: Useful targets:
#:
#----------------------------------------------------------------------
# Rule for getting help
#----------------------------------------------------------------------
.PHONY : help
#: help -- Print a list of targets
# This prints all lines in this Makefile that begin with #:
help :
@sed -n "s/^#://p" Makefile
#----------------------------------------------------------------------
# Always executed once when the Makefile is run
#----------------------------------------------------------------------
# Make sure the directory in which to place the objects exists
ignored := $(shell umask 2; test -d $(objectdir) || mkdir $(objectdir))
#----------------------------------------------------------------------
# Rules to compile and build libraries
#----------------------------------------------------------------------
.PHONY : all
#:
#: all (the default) -- Create the libraries
all : $(headerdir) $(LIBRARY) $(BDD_LIBRARIES)
$(LIBRARY) : $(OBJECTS)
libcal.a : $(CAL_OBJECTS) $(MDD_OBJECTS)
libcmu.a : $(CMU_OBJECTS) $(MDD_OBJECTS)
libcu.a : $(CU_OBJECTS) $(MDD_OBJECTS)
$(headerdir) : $(HEADERS) $(MDD_HEADERS)
rm -rf $(headerdir)
umask 2; mkdir $(headerdir)
for header in $(HEADERS) $(MDD_HEADERS); do \
ln $(local_srcdir)/src/*/$$header $(headerdir)/$$header; \
done
#----------------------------------------------------------------------
# Warts
#----------------------------------------------------------------------
# Work around an optimizer bug in the native Ultrix compiler
ifeq (@target@,mips-dec-ultrix4.5)
$(objectdir)/calReduce.o : calReduce.c
umask 2; $(CC) -c -std1 -g $(AC_FLAGS) $(INCLUDEDIRS) -o $@ $<
endif
# Work around a bug in gcc 2.7.0
ifeq ($(CC),gcc)
ifeq ($(shell gcc --version),2.7.0)
$(objectdir)/cal.o : cal.c
umask 2; $(CC) -c -g $(AC_FLAGS) $(INCLUDEDIRS) -o $@ $<
$(objectdir)/calBddSwapVars.o : calBddSwapVars.c
umask 2; $(CC) -c -g $(AC_FLAGS) $(INCLUDEDIRS) -o $@ $<
endif
endif
#----------------------------------------------------------------------
# Rules to build test programs
#----------------------------------------------------------------------
.PHONY : check check-bdd check-cal check-cmu check-cu
#:
#: check -- Test the libraries (runs check-bdd)
check : check-bdd
#: check-bdd -- Compile simple test programs for each of the BDD packages
#: and run them
check-bdd : check-cmu check-cal check-cu
check-cal : obj/checkcal
obj/checkcal > checkcal.out
@echo "Test appears successful -- results in checkcal.out"
obj/checkcal : libcal.a calTest.c
$(CC) -o obj/checkcal -DTEST $(CFLAGS) $(AC_FLAGS) $(INCLUDEDIRS) \
$(filter %.c, $^) -L. -lcal
check-cmu : obj/checkcmu
obj/checkcmu > checkcmu.out
@echo "Test appears successful -- results in checkcmu.out"
obj/checkcmu : libcmu.a $(LIBRARY) testbdd.c
$(CC) -o obj/checkcmu $(CFLAGS) $(AC_FLAGS) $(INCLUDEDIRS) \
$(filter %.c, $^) -L. -lcmu -l$(PRODUCT)
check-cu : obj/checkcu src/cuBdd/r7x8.1.mat
obj/checkcu -p 2 $(filter %.mat, $^) > checkcu.out
@echo "Test appears successful -- results in checkcu.out"
obj/checkcu : libcu.a $(LIBRARY) testcudd.c
$(CC) -o obj/checkcu $(CFLAGS) $(AC_FLAGS) $(INCLUDEDIRS) \
$(filter %.c, $^) -L. -lcu -l$(PRODUCT) -lm
#----------------------------------------------------------------------
# Rules that produce/delete the dependency file for every package
#----------------------------------------------------------------------
.PHONY : dependencies cleandependencies
#:
#: dependencies -- Create a list of dependency files.
#: Useful when modifying header files.
# Invoke the "dependency.make" Makefile on each package subdirectory,
# passing the path, etc. to it.
#
# There's a strange feature in autoconf where lines of the form " VPATH="
# are removed from the Makefile. Thus, a flag is placed before the
# VPATH= argument below.
dependencies:
ifneq ($(findstring <$(CC)>,<gcc> <g++> <icc> <icpc>),)
for pkg in $(PKGS) $(foreach bdd, $(BDD_PKGS), $(bdd)Bdd $(bdd)Port) \
$(MDD_PKGS) ; do \
$(MAKE) --no-print-directory \
-f $(master_srcdir)/helpers/dependency.make \
CC="$(CC)" \
CFLAGS="$(CFLAGS)" VPATH="$(local_srcdir)/src/$$pkg" \
AC_FLAGS="$(AC_FLAGS)" \
INCLUDEDIRS="$(INCLUDEDIRS)" objectdir=$(objectdir) \
PKGNAME=$(local_srcdir)/src/$$pkg/$$pkg \
$(local_srcdir)/src/$$pkg/$$pkg.d ; \
done
else
@echo "dependency requires gcc, g++, icc, or icpc"
@echo "Reconfigure with gcc, g++, icc, or icpc"
endif
cleandependencies:
rm -f $(local_srcdir)/src/*/*.d
#----------------------------------------------------------------------
# Rules for installation
#----------------------------------------------------------------------
.PHONY : install uninstall installdirs
#:
#: install -- Install the libraries and headers in libdir and includedir
install : $(LIBRARY) $(BDD_LIBRARIES) installdirs
@if [ ! -f $(libdir)/$(LIBRARY) ] ; \
then \
echo "Installing $(libdir)/$(LIBRARY)"; \
$(INSTALL_DATA) $(LIBRARY) $(libdir)/$(LIBRARY); \
else \
echo "Warning: $(libdir)/$(LIBRARY) already exists" ; \
fi
@for lib in $(BDD_LIBRARIES); do \
if [ ! -f $(libdir)/$$lib ] ; \
then \
echo "Installing $(libdir)/$$lib"; \
$(INSTALL_DATA) $$lib $(libdir)/$$lib; \
else \
echo "Warning: $(libdir)/$$lib already exists" ; \
fi ; \
done
@for header in $(HEADERS) $(MDD_HEADERS); do \
if [ ! -f $(includedir)/$$header ] ; \
then \
echo "Installing $(includedir)/$$header"; \
$(INSTALL_DATA) $(master_srcdir)/src/*/$$header \
$(includedir)/$$header; \
else \
echo "Warning: $(includedir)/$$header already exists"; \
fi ; \
done
#: uninstall -- Reverse the effects of "install"
uninstall :
rm -f $(libdir)/$(LIBRARY) $(addprefix $(libdir)/, $(BDD_LIBRARIES))
@for header in $(HEADERS) $(MDD_HEADERS); do \
echo "Removing $(includedir)/$$header"; \
rm -f $(includedir)/$$header; \
done
installdirs :
$(master_srcdir)/helpers/mkinstalldirs $(libdir) $(includedir)
#----------------------------------------------------------------------
# Rules for making a distribution file
# This only works when ALL of the packages are considered "local"
#----------------------------------------------------------------------
.PHONY : dist
#:
#: dist -- Create a tarred, gzipped distribution file
# Warning: "tar" under Digital Unix (on DEC Alphas) writes directories
# that don't work under SunOS tar
dist : $(DISTRIBUTION).tar.gz
$(DISTRIBUTION).tar.gz : $(DISTFILES)
ifeq ($(strip $(FULL_MISSING_PKGS)),)
rm -rf $(DISTRIBUTION)
umask 022; mkdir $(DISTRIBUTION)
for dir in $(DISTDIRS); do \
umask 022; mkdir $(DISTRIBUTION)/$$dir; \
done
@echo "Copying distribution files"
@for file in $(patsubst $(local_srcdir)/%, %, $^); do \
echo " $$file"; \
cp -p $(local_srcdir)/$$file $(DISTRIBUTION)/$$file; \
done
- chmod -R a+r $(DISTRIBUTION)
- chmod -R u+w $(DISTRIBUTION)
tar cf - $(DISTRIBUTION) | gzip -9 > $(DISTRIBUTION).tar.gz
rm -rf $(DISTRIBUTION)
else
@echo "Missing packages: $(FULL_MISSING_PKGS)"
@echo "Make sure PKGS, BDD_PKGS, and MDD_PKGS list all the packages"
@exit 1
endif
#----------------------------------------------------------------------
# Rules for rebuilding the configure file and Makefile
#----------------------------------------------------------------------
${master_srcdir}/configure : configure.in
cd ${master_srcdir} && autoconf
chmod -f 0775 ${master_srcdir}/config*
config.status : configure
./config.status --recheck
Makefile : Makefile.in config.status
@echo "The master Makefile.in has been changed:"
@echo "run config.status"
@echo "Warning: This will overwrite any local Makefile modifications"
@exit 1
#----------------------------------------------------------------------
# Rules for cleaning
#----------------------------------------------------------------------
.PHONY : clean mostlyclean distclean
clean mostlyclean :
rm -rf $(objectdir)/* include checkcal.out checkcmu.out checkcu.out
distclean : clean cleandependencies
rm -f Makefile config.status config.cache config.log $(LIBRARY) \
$(BDD_LIBRARIES)
#----------------------------------------------------------------------
# Rule for performing a lint-like check on the source code
#
# Note: This requires gcc or g++
#----------------------------------------------------------------------
.PHONY : check_code
#:
#: check-code -- Run a lint-like check on the source code.
#: (useful for development)
CHECK_FLAGS := -Wall -pedantic
ifeq ($(CC),gcc)
CHECK_FLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
endif
check-code : $(CSRC) $(BDD_CSRC) $(MDD_CSRC)
ifneq ($(findstring <$(CC)>,<gcc> <g++>),)
@rm -f *.o_checkcode
@for file in $^; do \
echo "------------------------ Checking $$file"; \
$(CC) -c $(CFLAGS) $(AC_FLAGS) $(CHECK_FLAGS) \
$(VERDATE) $(INCLUDEDIRS) \
-o $(objectdir)/checkcode_output.o $$file; \
rm -f $(objectdir)/checkcode_output.o; \
done
@rm -f *.o_checkcode
else
@echo "check-code requires gcc or g++"
@echo "Reconfigure with gcc or g++"
endif
#----------------------------------------------------------------------
# Revision control rules
#
# May be invoked with command-line overrides, e.g.,
# gmake RCSFILES=foo.c rcs_co
# gmake PKGS=array rcs_ci
#----------------------------------------------------------------------
.PHONY: rcs_ci rcs_co rcs_diff rcs_ident rcs_status
#:
#: You may want to invoke the RCS rules with
#: gmake "PKGS=tst tbl" rcs_ci
#: gmake "RCSFILES=tstMain.c" rcs_co
#:
#: rcs_ci -- check in user-modified files and put an updated copy
#: in the central area
rcs_ci: $(RCSFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
ci -u $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
co -u $(RCSFLAGS) $(master_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_co -- check out files for modification
rcs_co: $(RCSFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
co -l $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_diff -- Report differences between local files and checked-in versions
rcs_diff: $(RCSFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
rcsdiff $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_ident -- Print the RCS identifier in each file
rcs_ident: $(RCSFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
ident $(RCSFLAGS) $(local_srcdir)/$$file; \
done
#: rcs_status -- Report who has checked out files
rcs_status: $(RCSFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
rlog -L -h $(RCSFLAGS) $(rcs_rootdir)/$$file,v; \
done
#----------------------------------------------------------------------
# RCS rules for common/{Makefile.in, configure.in, localconfigure,
# masterconfigure, mkinstalldirs, install-sh}
#----------------------------------------------------------------------
.PHONY : rcs_ci_misc rcs_co_misc rcs_diff_misc
#: rcs_ci_misc -- Check in miscellaneous files, updating central area
rcs_ci_misc: $(RCSMISCFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
ci -u $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
co -u $(RCSFLAGS) $(master_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_co_misc -- Check out miscellaneous files
rcs_co_misc: $(RCSMISCFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
co -l $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_diff_misc -- Report differences in miscellaneous files
rcs_diff_misc: $(RCSMISCFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
rcsdiff $(RCSFLAGS) $(local_srcdir)/$$file $(rcs_rootdir)/$$file,v; \
done
#: rcs_ident_misc -- Report RCS identifiers
rcs_ident_misc: $(RCSMISCFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
ident $(RCSFLAGS) $(local_srcdir)/$$file; \
done
#: rcs_status_misc -- Report checked in/out status, ownership
rcs_status_misc: $(RCSMISCFILES)
@for file in $(patsubst $(local_srcdir)/%, %, $^); \
do \
rlog -L -h $(RCSFLAGS) $(rcs_rootdir)/$$file,v; \
done
#----------------------------------------------------------------------
# Rules for debugging the Makefile
#----------------------------------------------------------------------
DEBUG_VARS = PKGS \
BDD_PKGS \
ALL_BASIC_PKGS \
ALL_BDD_PKGS \
ALL_MDD_PKGS \
MISSING_PKGS \
MISSING_BDD_PKGS \
MISSING_MDD_PKGS \
FULL_PKGS \
FULL_MISSING_PKGS \
SHELL \
PRODUCT \
VERSION \
prefix \
exec_prefix \
master_srcdir \
local_srcdir \
libdir \
includedir \
objectdir \
headerdir \
LIBRARY \
BDD_LIBRARIES \
AC_FLAGS \
RANLIB \
CC \
CFLAGS \
INSTALL \
INSTALL_DATA \
MAKEINCLUDES \
OBJECTS \
BDD_CSRC \
BDD_HEADERS \
CAL_OBJECTS \
CMU_OBJECTS \
CU_OBJECTS \
MDD_CSRC \
MDD_HEADERS \
MDD_OBJECTS \
INCLUDEDIRS \
VPATH \
DISTRIBUTION \
DISTDIRS \
DISTFILES \
GLU \
RCSFILES \
rcs_rootdir \
RCSMISCFILES
.PHONY : debug-make
#:
#: debug-make - Print a list of Makefile variables
debug-make:
@$(foreach var, $(DEBUG_VARS), echo $(var)=$($(var)) ; )