Changed to look for configure.ac, then configure.in
[pwlib.git] / make / common.mak
blobbce95e790ccafb6085c3d171feaaba3de5d17d51
2 # common.mak
4 # Common make rules included in ptlib.mak and pwlib.mak
6 # Portable Windows Library
8 # Copyright (c) 1993-1998 Equivalence Pty. Ltd.
10 # The contents of this file are subject to the Mozilla Public License
11 # Version 1.0 (the "License"); you may not use this file except in
12 # compliance with the License. You may obtain a copy of the License at
13 # http://www.mozilla.org/MPL/
15 # Software distributed under the License is distributed on an "AS IS"
16 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 # the License for the specific language governing rights and limitations
18 # under the License.
20 # The Original Code is Portable Windows Library.
22 # The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24 # Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25 # All Rights Reserved.
27 # Contributor(s): ______________________________________.
29 # $Log$
30 # Revision 1.94 2004/06/10 01:36:44 csoutheren
31 # Fixed problems with static links
33 # Revision 1.93 2004/04/29 14:07:07 csoutheren
34 # Changed install target to use $(INSTALL)
35 # Various makefile cleanups and verified install and uninstall targets
36 # Removed some vestiges of old GUI code
38 # Revision 1.92 2004/04/24 06:26:03 rjongbloed
39 # Fixed very bizarre problem with GNU GCC 3.4.0 and generating dependencies,
40 # cannot have -g and -M on the command line at the same time!
42 # Revision 1.91 2004/04/21 12:05:04 csoutheren
43 # Added target to create gcc compiled header for ptlib.h, but not used
44 # because it does not seem to be able to compile some files
46 # Revision 1.90 2004/04/14 10:21:15 csoutheren
47 # Grrr...more changes for CXX flags
49 # Revision 1.89 2004/04/14 10:07:00 csoutheren
50 # Added CXXFLAGS
52 # Revision 1.88 2003/12/29 07:15:31 csoutheren
53 # Fixed problem with creating statically linked executables
55 # Revision 1.87 2003/11/02 15:57:56 shawn
56 # remove -static for Mac OS X
58 # Revision 1.86 2003/10/03 00:36:59 dereksmithies
59 # Fix generation of dependencies. Thanks to Vyacheslav Frolov
61 # Revision 1.85 2003/07/29 11:25:23 csoutheren
62 # Added support for system swab function
64 # Revision 1.84 2003/07/24 22:01:42 dereksmithies
65 # Add fixes from Peter Nixon for fixing install problems. Thanks.
67 # Revision 1.83 2003/06/17 12:05:01 csoutheren
68 # Changed compiler flags for optimised build
70 # Revision 1.82 2003/02/03 06:08:52 robertj
71 # Changed tagbuild so leaves a cvs sticky version of sources to that tag.
73 # Revision 1.81 2002/11/15 06:36:59 robertj
74 # Changed so library build only occurs if source is present.
76 # Revision 1.80 2002/10/10 04:43:44 robertj
77 # VxWorks port, thanks Martijn Roest
79 # Revision 1.79 2002/08/30 11:41:33 robertj
80 # Added guarantee that version numbers exist.
82 # Revision 1.78 2002/08/30 02:23:13 craigs
83 # Added changes for correct creation of debug libraries
84 # thanks to Martin Froehlich
86 # Revision 1.77 2002/06/25 04:13:07 robertj
87 # Added symbol NODEPS so dependency files are not included, very useful for
88 # when they get corrupted so don;t have to manually delete them.
90 # Revision 1.76 2002/04/08 00:41:50 robertj
91 # Added dependency build to "make libs" target.
93 # Revision 1.75 2002/04/01 09:14:09 rogerh
94 # Add noshared build targets
96 # Revision 1.74 2002/02/25 16:23:16 rogerh
97 # Test for GCC 3 in unix.mak and not it common.mak so -DGCC3 can be set
99 # Revision 1.73 2002/02/19 06:26:29 rogerh
100 # Move $$BLD outside quotes so it gets expanded correctly
102 # Revision 1.72 2002/02/18 07:39:04 robertj
103 # Changed version number increment to more portable expr function.
105 # Revision 1.71 2002/01/28 10:33:20 rogerh
106 # use CPLUS instead of gcc. Makes it work on Mac OS X
108 # Revision 1.70 2002/01/28 00:19:59 craigs
109 # Made gcc 3 changes dependent on having gcc 3.0 installed
111 # Revision 1.69 2001/12/17 23:33:50 robertj
112 # Solaris 8 porting changes, thanks James Dugal
114 # Revision 1.68 2001/11/29 07:50:42 robertj
115 # Removed static, it doesn't work either
117 # Revision 1.67 2001/11/29 03:16:49 robertj
118 # Made make noshared completely static
120 # Revision 1.66 2001/11/28 02:44:14 robertj
121 # Fixed attempt to do static link on debug version, causes crashes.
123 # Revision 1.65 2001/11/27 22:42:13 robertj
124 # Changed to make system to better support non-shared library building.
126 # Revision 1.64 2001/10/31 00:45:20 robertj
127 # Added debuglibs, optlibs and bothlibs targets, moving help to where these
128 # targets are in teh make file system.
130 # Revision 1.63 2001/10/12 07:25:33 robertj
131 # Removed diff test, cvs commit already does compare
133 # Revision 1.62 2001/10/12 06:18:41 robertj
134 # Fixed check of change of version file for tagbuild
136 # Revision 1.61 2001/10/09 08:53:26 robertj
137 # Added LIBDIRS variable so can go "make libs" and make all libraries.
138 # Added "make version" target to display version of project.
139 # Added inclusion of library versions into "make tagbuild" check in.
141 # Revision 1.60 2001/08/07 08:24:42 robertj
142 # Fixed bug in tagbuild if have more than one BUILD_NUMBER in file.
144 # Revision 1.59 2001/07/30 07:45:54 robertj
145 # Added "all" target with double colon.
147 # Revision 1.58 2001/07/27 14:39:12 robertj
148 # Allowed libs target to have multiple definitions
150 # Revision 1.57 2001/06/30 06:59:06 yurik
151 # Jac Goudsmit from Be submit these changes 6/28. Implemented by Yuri Kiryanov
153 # Revision 1.56 2001/06/29 06:47:30 robertj
154 # Added missing dollar sign
156 # Revision 1.55 2001/06/29 06:41:03 robertj
157 # Fixed make tagbuild for different #defines
159 # Revision 1.54 2001/05/29 03:31:48 craigs
160 # Removed BROKEN_GCC symbol, now that pwlib is totally gcc friendly
162 # Revision 1.53 2001/03/29 04:48:45 robertj
163 # Added tagbuild target to do CVS tag and autoincrement BUILD_NUMBER
164 # Changed order so version.h is used before custom.cxx
166 # Revision 1.52 2001/03/23 19:59:48 craigs
167 # Added detection of broken gcc versions
169 # Revision 1.51 2001/03/22 01:14:16 robertj
170 # Allowed for the version file #defines to configured by calling makefile.
172 # Revision 1.50 2000/11/02 04:46:42 craigs
173 # Added support for buildnum.h file for version numbers
175 # Revision 1.49 2000/10/01 01:08:10 craigs
176 # Fixed problems with Motif build
178 # Revision 1.48 2000/09/20 23:59:35 craigs
179 # Fixed problem with bothnoshared target
181 # Revision 1.47 2000/04/26 00:40:48 robertj
182 # Redesigned version number system to have single file to change on releases.
184 # Revision 1.46 2000/04/06 20:12:33 craigs
185 # Added install targets
187 # Revision 1.45 2000/03/20 23:08:31 craigs
188 # Added showgui target to allow displaying the GUI settings
190 # Revision 1.44 2000/03/20 22:43:09 craigs
191 # Added totally new mechanism for detecting GUI
193 # Revision 1.43 2000/03/03 00:37:42 robertj
194 # Fixed problem for when have GUI environment variable set, always builds GUI!
196 # Revision 1.42 2000/02/24 11:02:11 craigs
197 # Fixed problems with PW make
199 # Revision 1.41 2000/02/16 11:30:25 craigs
200 # Added rule to force library build for applications
202 # Revision 1.40 2000/02/04 19:33:25 craigs
203 # Added ability to create non-shared versions of programs
205 # Revision 1.39 2000/01/22 00:51:18 craigs
206 # Added ability to compile in any directory, and to create shared libs
208 # Revision 1.38 1999/07/10 03:32:02 robertj
209 # Improved release version detection code.
211 # Revision 1.37 1999/07/03 04:31:53 robertj
212 # Fixed problems with not including oss.cxx in library if OSTYPE not "linux"
214 # Revision 1.36 1999/07/02 05:10:33 robertj
215 # Fixed bug in changing from debug default to opt build
217 # Revision 1.35 1999/06/28 09:12:01 robertj
218 # Fixed problems with the order in which macros are defined especially on BeOS & Solaris
220 # Revision 1.34 1999/06/27 02:42:10 robertj
221 # Fixed BeOS compatability.
222 # Fixed error of platform name not supported, needed :: on main targets.
224 # Revision 1.33 1999/06/09 15:41:18 robertj
225 # Added better UI to make files.
227 # Revision 1.32 1999/04/18 09:36:31 robertj
228 # Get date grammar build.
230 # Revision 1.31 1999/02/19 11:32:10 robertj
231 # Improved the "release" target to build release tar files.
233 # Revision 1.30 1999/01/16 09:56:24 robertj
234 # Changed some macros to more informative names.
236 # Revision 1.29 1999/01/16 04:00:05 robertj
237 # Added bothclean target
239 # Revision 1.28 1998/12/02 02:36:57 robertj
240 # New directory structure.
242 # Revision 1.27 1998/11/26 12:48:20 robertj
243 # Support for .c files.
245 # Revision 1.26 1998/11/26 11:40:03 craigs
246 # Added checking for resource compilation
248 # Revision 1.25 1998/11/26 07:29:19 craigs
249 # Yet another bash at a GUI build environment
251 # Revision 1.24 1998/11/24 03:41:32 robertj
252 # Fixed problem where failed make depend leaves bad .dep files behind
254 # Revision 1.23 1998/11/22 10:41:02 craigs
255 # New GUI build system - for sure!
257 # Revision 1.22 1998/11/22 08:11:31 craigs
258 # *** empty log message ***
260 # Revision 1.21 1998/09/24 04:20:49 robertj
261 # Added open software license.
264 ######################################################################
266 # common rules
268 ######################################################################
270 # Submodules built with make lib
271 LIBDIRS += $(PWLIBDIR)
274 ifndef OBJDIR
275 OBJDIR = ./$(PT_OBJBASE)
276 endif
278 vpath %.cxx $(VPATH_CXX)
279 vpath %.c $(VPATH_C)
280 vpath %.o $(OBJDIR)
281 vpath %.dep $(DEPDIR)
282 vpath %.gch $(PWLIBDIR)/include
285 # add common directory to include path - must be after PW and PT directories
287 STDCCFLAGS += -I$(PWLIBDIR)/include
289 ifneq ($(P_SHAREDLIB),1)
291 #ifneq ($(OSTYPE),Darwin) # Mac OS X does not really support -static
292 #LDFLAGS += -static
293 #endif
295 ifneq ($(P_STATIC_LDFLAGS),)
296 LDFLAGS += $(P_STATIC_LDFLAGS)
297 endif
299 ifneq ($(P_STATIC_ENDLDLIBS),)
300 ENDLDLIBS += $(P_STATIC_ENDLDLIBS)
301 endif
303 endif
305 # clean whitespace out of source file list
306 SOURCES := $(strip $(SOURCES))
309 # define rule for .cxx and .c files
311 $(OBJDIR)/%.o : %.cxx
312 @if [ ! -d $(OBJDIR) ] ; then mkdir -p $(OBJDIR) ; fi
313 $(CPLUS) $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) $(STDCXXFLAGS) -x c++ -c $< -o $@
315 $(OBJDIR)/%.o : %.c
316 @if [ ! -d $(OBJDIR) ] ; then mkdir -p $(OBJDIR) ; fi
317 $(CC) $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) -x c -c $< -o $@
320 # create list of object files
322 SRC_OBJS := $(SOURCES:.c=.o)
323 SRC_OBJS := $(SRC_OBJS:.cxx=.o)
324 OBJS := $(EXTERNALOBJS) $(patsubst %.o, $(OBJDIR)/%.o, $(notdir $(SRC_OBJS) $(OBJS)))
327 # create list of dependency files
329 DEPDIR := $(OBJDIR)
330 SRC_DEPS := $(SOURCES:.c=.dep)
331 SRC_DEPS := $(SRC_DEPS:.cxx=.dep)
332 DEPS := $(patsubst %.dep, $(DEPDIR)/%.dep, $(notdir $(SRC_DEPS) $(DEPS)))
335 # define rule for .dep files
337 $(DEPDIR)/%.dep : %.cxx
338 @if [ ! -d $(DEPDIR) ] ; then mkdir -p $(DEPDIR) ; fi
339 @printf %s $(OBJDIR)/ > $@
340 $(CPLUS) $(STDCCFLAGS:-g=) -M $< >> $@
342 $(DEPDIR)/%.dep : %.c
343 @if [ ! -d $(DEPDIR) ] ; then mkdir -p $(DEPDIR) ; fi
344 @printf %s $(OBJDIR)/ > $@
345 $(CC) $(STDCCFLAGS:-g=) -M $< >> $@
348 # add in good files to delete
350 CLEAN_FILES += $(OBJS) $(DEPS) core
352 ######################################################################
354 # rules for application
356 ######################################################################
358 ifdef PROG
360 ifndef TARGET
361 TARGET = $(OBJDIR)/$(PROG)
362 endif
364 ifdef BUILDFILES
365 OBJS += $(OBJDIR)/buildnum.o
366 endif
368 TARGET_LIBS = $(PWLIBDIR)/lib/$(PTLIB_FILE)
370 # distinguish betweek building and using pwlib
371 ifeq (,$(wildcard $(PWLIBDIR)/src))
372 TARGET_LIBS = $(SYSLIBDIR)/$(PTLIB_FILE)
373 endif
375 $(TARGET): $(OBJS) $(TARGET_LIBS)
376 ifeq ($(OSTYPE),beos)
377 # BeOS won't find dynamic libraries unless they are in one of the system
378 # library directories or in the lib directory under the application's
379 # directory
380 @if [ ! -L $(OBJDIR)/lib ] ; then cd $(OBJDIR); ln -s $(PW_LIBDIR) lib; fi
381 endif
382 $(CPLUS) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) $(ENDLDLIBS) $(ENDLDFLAGS)
383 ifeq ($(OSTYPE),VxWorks)
384 $(LD) --split-by-reloc 65535 -r $(OBJS) -o $@
385 endif
387 ifdef DEBUG
389 ifneq (,$(wildcard $(PWLIBDIR)/src/ptlib/unix))
390 $(PW_LIBDIR)/$(PTLIB_FILE):
391 $(MAKE) -C $(PWLIBDIR)/src/ptlib/unix debug
392 endif
394 else
396 ifneq (,$(wildcard $(PWLIBDIR)/src/ptlib/unix))
397 $(PW_LIBDIR)/$(PTLIB_FILE):
398 $(MAKE) -C $(PWLIBDIR)/src/ptlib/unix opt
399 endif
401 endif
403 CLEAN_FILES += $(TARGET)
405 ifndef INSTALL_OVERRIDE
407 install: $(TARGET)
408 $(INSTALL) $(TARGET) $(INSTALLBIN_DIR)
409 endif
411 # ifdef PROG
412 endif
414 $(PWLIBDIR)/include/ptlib.h.gch: $(PWLIBDIR)/include/ptlib.h
415 @if [ ! -d $(OBJDIR) ] ; then mkdir -p $(OBJDIR) ; fi
416 $(CPLUS) $(STDCCFLAGS) $(OPTCCFLAGS) $(CFLAGS) $(STDCXXFLAGS) -x c++ -c $< -o $@
418 PCH := $(PWLIBDIR)/include/ptlib.h.gch
420 ######################################################################
422 # Main targets for build management
424 ######################################################################
426 all :: debuglibs debugdepend debug optlibs optdepend opt
428 help:
429 @echo "The following targets are available:"
430 @echo " make debug Make debug version of application"
431 @echo " make opt Make optimised version of application"
432 @echo " make both Make both versions of application"
433 @echo
434 @echo " make debugnoshared Make static debug version of application"
435 @echo " make optnoshared Make static optimised version of application"
436 @echo " make bothnoshared Make static both versions of application"
437 @echo
438 @echo " make debugclean Remove debug files"
439 @echo " make optclean Remove optimised files"
440 @echo " make clean Remove both debug and optimised files"
441 @echo
442 @echo " make debugdepend Create debug dependency files"
443 @echo " make optdepend Create optimised dependency files"
444 @echo " make bothdepend Create both debug and optimised dependency files"
445 @echo
446 @echo " make debuglibs Make debug libraries project depends on"
447 @echo " make optlibs Make optimised libraries project depends on"
448 @echo " make bothlibs Make both debug and optimised libraries project depends on"
449 @echo
450 @echo " make all Create debug & optimised dependencies & libraries"
451 @echo
452 @echo " make version Display version for project"
453 @echo " make tagbuild Do a CVS tag of the source, and bump build number"
454 @echo " make release Package up optimised version int tar.gz file"
457 ifdef DEBUG
459 debug :: $(TARGET)
461 opt ::
462 @$(MAKE) DEBUG= opt
464 debugclean ::
465 rm -rf $(CLEAN_FILES)
467 optclean ::
468 @$(MAKE) DEBUG= optclean
470 .DELETE_ON_ERROR : debugdepend
472 debugdepend :: $(DEPS)
473 @echo Created dependencies.
475 optdepend ::
476 @$(MAKE) DEBUG= optdepend
478 debuglibs :: libs
480 optlibs ::
481 @$(MAKE) DEBUG= libs
483 libs ::
484 set -e; for i in $(LIBDIRS); do $(MAKE) -C $$i debugdepend debug; done
486 else
488 debug ::
489 @$(MAKE) DEBUG=1 debug
491 opt :: $(TARGET)
493 debugclean ::
494 @$(MAKE) DEBUG=1 debugclean
496 optclean ::
497 rm -rf $(CLEAN_FILES)
499 .DELETE_ON_ERROR : optdepend
501 debugdepend ::
502 @$(MAKE) DEBUG=1 debugdepend
504 optdepend :: $(DEPS)
505 @echo Created dependencies.
507 debuglibs ::
508 @$(MAKE) DEBUG=1 libs
510 optlibs :: libs
512 libs ::
513 set -e; for i in $(LIBDIRS); do $(MAKE) -C $$i optdepend opt; done
515 endif
517 both :: opt debug
518 clean :: optclean debugclean
519 bothdepend :: optdepend debugdepend
520 bothlibs :: optlibs debuglibs
522 optshared ::
523 $(MAKE) P_SHAREDLIB=1 opt
525 debugshared ::
526 $(MAKE) P_SHAREDLIB=1 debug
528 bothshared ::
529 $(MAKE) optshared debugshared
531 optnoshared ::
532 $(MAKE) P_SHAREDLIB=0 opt
534 debugnoshared ::
535 $(MAKE) P_SHAREDLIB=0 debug
537 bothnoshared ::
538 $(MAKE) optnoshared debugnoshared
542 ######################################################################
544 # common rule to make a release of the program
546 ######################################################################
548 # if have not explictly defined VERSION_FILE, locate a default
550 ifndef VERSION_FILE
551 ifneq (,$(wildcard buildnum.h))
552 VERSION_FILE := buildnum.h
553 else
554 ifneq (,$(wildcard version.h))
555 VERSION_FILE := version.h
556 else
557 ifneq (,$(wildcard custom.cxx))
558 VERSION_FILE := custom.cxx
559 endif
560 endif
561 endif
562 endif
565 ifdef VERSION_FILE
567 # Set default strings to search in VERSION_FILE
568 ifndef MAJOR_VERSION_DEFINE
569 MAJOR_VERSION_DEFINE:=MAJOR_VERSION
570 endif
571 ifndef MINOR_VERSION_DEFINE
572 MINOR_VERSION_DEFINE:=MINOR_VERSION
573 endif
574 ifndef BUILD_NUMBER_DEFINE
575 BUILD_NUMBER_DEFINE:=BUILD_NUMBER
576 endif
579 # If not specified, find the various version components in the VERSION_FILE
581 ifndef MAJOR_VERSION
582 MAJOR_VERSION:=$(strip $(subst \#define,, $(subst $(MAJOR_VERSION_DEFINE),,\
583 $(shell grep "define *$(MAJOR_VERSION_DEFINE) *" $(VERSION_FILE)))))
584 endif
585 ifndef MINOR_VERSION
586 MINOR_VERSION:=$(strip $(subst \#define,, $(subst $(MINOR_VERSION_DEFINE),,\
587 $(shell grep "define *$(MINOR_VERSION_DEFINE)" $(VERSION_FILE)))))
588 endif
589 ifndef BUILD_TYPE
590 BUILD_TYPE:=$(strip $(subst \#define,,$(subst BUILD_TYPE,,\
591 $(subst AlphaCode,alpha,$(subst BetaCode,beta,$(subst ReleaseCode,.,\
592 $(shell grep "define *BUILD_TYPE" $(VERSION_FILE))))))))
593 endif
594 ifndef BUILD_NUMBER
595 BUILD_NUMBER:=$(strip $(subst \#define,,$(subst $(BUILD_NUMBER_DEFINE),,\
596 $(shell grep "define *$(BUILD_NUMBER_DEFINE)" $(VERSION_FILE)))))
597 endif
599 # Finally check that version numbers are not empty
601 ifeq (,$(MAJOR_VERSION))
602 override MAJOR_VERSION:=1
603 endif
604 ifeq (,$(MINOR_VERSION))
605 override MINOR_VERSION:=0
606 endif
607 ifeq (,$(BUILD_TYPE))
608 override BUILD_TYPE:=alpha
609 endif
610 ifeq (,$(BUILD_NUMBER))
611 override BUILD_NUMBER:=0
612 endif
614 # Check for VERSION either predefined or defined by previous section from VERSION_FILE
615 ifndef VERSION
616 VERSION:=$(MAJOR_VERSION).$(MINOR_VERSION)$(BUILD_TYPE)$(BUILD_NUMBER)
617 endif # ifndef VERSION
618 endif # ifdef VERSION_FILE
620 # Build the CVS_TAG string from the components
621 ifndef CVS_TAG
622 CVS_TAG := v$(MAJOR_VERSION)_$(MINOR_VERSION)$(subst .,_,$(BUILD_TYPE))$(BUILD_NUMBER)
623 endif
625 ifdef DEBUG
627 # Cannot do this in DEBUG mode, so do it without DEBUG
629 release ::
630 $(MAKE) DEBUG= release
632 else
635 ifndef VERSION
637 release ::
638 @echo Must define VERSION macro or have version.h/custom.cxx file.
640 tagbuild ::
641 @echo Must define VERSION macro or have version.h/custom.cxx file.
643 else # ifdef VERSION
645 # "make release" definition
647 ifndef RELEASEDIR
648 RELEASEDIR=releases
649 endif
651 ifndef RELEASEBASEDIR
652 RELEASEBASEDIR=$(PROG)
653 endif
655 RELEASEPROGDIR=$(RELEASEDIR)/$(RELEASEBASEDIR)
657 release :: $(TARGET) releasefiles
658 cp $(TARGET) $(RELEASEPROGDIR)/$(PROG)
659 cd $(RELEASEDIR) ; tar chf - $(RELEASEBASEDIR) | gzip > $(PROG)_$(VERSION)_$(PLATFORM_TYPE).tar.gz
660 rm -r $(RELEASEPROGDIR)
662 releasefiles ::
663 -mkdir -p $(RELEASEPROGDIR)
666 version:
667 @echo v$(VERSION) " CVS tag:" `cvs status Makefile | grep "Sticky Tag" | sed -e "s/(none)/HEAD/" -e "s/(.*)//" -e "s/^.*://"`
670 ifndef VERSION_FILE
672 tagbuild ::
673 @echo Must define VERSION_FILE macro or have version.h/custom.cxx file.
675 else # ifndef VERSION_FILE
677 ifndef CVS_TAG
679 tagbuild ::
680 @echo Must define CVS_TAG macro or have version.h/custom.cxx file.
682 else # ifndef CVS_TAG
684 tagbuild ::
685 sed $(foreach dir,$(LIBDIRS), -e "s/ $(notdir $(dir)):.*/ $(notdir $(dir)): $(shell $(MAKE) -s -C $(dir) version)/") $(VERSION_FILE) > $(VERSION_FILE).new
686 mv -f $(VERSION_FILE).new $(VERSION_FILE)
687 cvs commit -m "Pre-tagging check in for $(CVS_TAG)." $(VERSION_FILE)
688 cvs tag -c $(CVS_TAG)
689 BLD=`expr $(BUILD_NUMBER) + 1` ; \
690 echo "Incrementing to build number " $$BLD; \
691 sed "s/$(BUILD_NUMBER_DEFINE)[ ]*[0-9][0-9]*/$(BUILD_NUMBER_DEFINE) $$BLD/" $(VERSION_FILE) > $(VERSION_FILE).new
692 mv -f $(VERSION_FILE).new $(VERSION_FILE)
693 cvs commit -m "Incremented build number after tagging to $(CVS_TAG)." $(VERSION_FILE)
694 cvs -q update -r $(CVS_TAG)
696 endif # else ifndef CVS_TAG
698 endif # else ifndef VERSION_FILE
700 endif # else ifdef VERSION
702 endif # else ifdef DEBUG
705 ######################################################################
707 # rules for creating build number files
709 ######################################################################
711 ifdef BUILDFILES
712 $(OBJDIR)/buildnum.o: buildnum.c
713 cc -o $(OBJDIR)/buildnum.o -c buildnum.c
715 #ifndef DEBUG
716 #buildnum.c: $(SOURCES) $(BUILDFILES)
717 # buildinc buildnum.c
718 #else
719 buildnum.c:
720 #endif
722 endif
724 ######################################################################
726 # Include all of the dependencies
728 ######################################################################
730 ifndef NODEPS
731 -include $(DEPDIR)/*.dep
732 endif
735 # End of common.mak