From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from minnie.tuhs.org (minnie.tuhs.org [IPv6:2600:3c01:e000:146::1]) by inbox.vuxu.org (Postfix) with ESMTP id 5007624045 for ; Wed, 19 Jun 2024 16:44:42 +0200 (CEST) Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id BE35F43283; Thu, 20 Jun 2024 00:44:36 +1000 (AEST) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by minnie.tuhs.org (Postfix) with ESMTPS id 0E62742A9B for ; Thu, 20 Jun 2024 00:44:29 +1000 (AEST) Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2c7a51e21ebso1339864a91.2 for ; Wed, 19 Jun 2024 07:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1718808268; x=1719413068; darn=tuhs.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bdyKUB4na24aQf9FbLYanm7j4X+XcINKDqsCs4Jcbww=; b=nc5Cz0yZwbSrkwDtr+Eh7fo7YcKuWSGQ72UwRNyj3V8P8GK8Cl8JKva5slKeDKaEHi KN/yIS/C4rqFwGpEKdPyCfdJ2AHgdc3LSMAhV0V7HFExNNB2h48JDVvjz8LIxMbBMLED BotNqn10/Kt92VkLymLk85YYvaWR0+MUPjlILKGlOHNYndMVJ6zvGMpYgh2cXg3YyAWT cvWN1/GT8oXpE/dkHBnCKeTIyAstnz7g362oeB973XiWWC+6biE0lRybcLnnYRj169S3 rZKQy1OPzCBSjAcqECkbXJW3CHW2arb3HjPT9IWdiJJu8CGqAwBdfX6RbB5TdFsGbpbV he0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718808268; x=1719413068; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bdyKUB4na24aQf9FbLYanm7j4X+XcINKDqsCs4Jcbww=; b=YK0aD+9kklZujLwKxjW5uerfyfNjioorRpm0tuKIHctd7Gy28lLTwKCFtiJUo6W1l+ 9m5HlzdId5UZYD+4vIYaV+pQJjjrU+rq0w5Spb+bn854HSB/K1yk2kDknSNgHGzFjEA/ rVK25tGBL8+AB6XFXzBTVq9/aBeBTiBf0nLMfpVU5zCTUw6y8ILOJ0paO35sj10ieZiH LRgtQM1kbeju99Ydsjj3a8+/pKMxMdg3y6r2cgR+SNmC3Pd6pSwevrjwpOA40OWp2Bvw pZrqOZ2PnAI7Y8RhlCGvLrNtXGbJhZsaRKzqNwZ5/AOTF9ONdQ9Dd50x5616RJg5SzYV oCbA== X-Forwarded-Encrypted: i=1; AJvYcCWxX9kWAZZC+8znszciJFm/4x9XVo+sFWkH4M7ymkbR2qv8DV0nJVaR2DyqEe7xf6/SVY0h2RnNHdXwAlhh X-Gm-Message-State: AOJu0YzzckTIhe8jtzoLNNCb0ZVgOS8TKH9gj5OBqZ1t9nWTKerNqpLP SLzwEjPHDwjrS5rLfVx6cFcsIGH91V51XoqF1iGufsSpFfLPKHtZGz0mnrUcmaqNs/ZVx9qP94R qFoew+EBbD3yEqtMv+/GskZ5SO4Yp8cNFw31YSQ== X-Google-Smtp-Source: AGHT+IFI3SLjFGgGuTHIART0Ng7J1GLXiSc1KThV3tq6vyygIuIC2z5qEhbV80BYaXzVKJpwuegx1qcEveno7xMS2r0= X-Received: by 2002:a17:90b:1241:b0:2c7:b1ad:6df0 with SMTP id 98e67ed59e1d1-2c7b5da57d0mr2611810a91.32.1718808267728; Wed, 19 Jun 2024 07:44:27 -0700 (PDT) MIME-Version: 1.0 References: <87iky84c23.fsf@gmail.com> <20240617012531.GE12821@mcvoy.com> <0e6792ed-65b0-e2e1-8159-6426a7f15a8d@riddermarkfarm.ca> <9f9db0d2-8a6a-26cc-a0ba-b6fc5d6474cb@makerlisp.com> <20240619132846.GR32048@mcvoy.com> In-Reply-To: <20240619132846.GR32048@mcvoy.com> From: Warner Losh Date: Wed, 19 Jun 2024 08:44:14 -0600 Message-ID: To: Larry McVoy Content-Type: multipart/alternative; boundary="0000000000003c4553061b3f3c67" Message-ID-Hash: BV6KPDOEURGAY6IOL5JM7DGKTKJRK6JI X-Message-ID-Hash: BV6KPDOEURGAY6IOL5JM7DGKTKJRK6JI X-MailFrom: wlosh@bsdimp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: The Eunuchs Hysterical Society X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: Version 256 of systemd boasts '42% less Unix philosophy' The Register List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --0000000000003c4553061b3f3c67 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 19, 2024, 7:28=E2=80=AFAM Larry McVoy wrote: > On Tue, Jun 18, 2024 at 07:46:15PM -0500, Nevin Liber wrote: > > But I'll bite. There was the claim by Larry McVoy that "Writing > Makefiles > > isn't that hard". > > > > Please show these beautiful makefiles for a non-toy non-trivial product > > Works on *BSD, MacOS, Windows, Linux on a bunch of different architecture= s, > Solaris, HPUX, AIX, IRIX, Tru64, etc. > The posted Makefile is no a strictly conforming POSIX Makefile, but uses gmake extensions extensively... And eyes of the beholder may vary... Warner # Copyright 1999-2016 BitMover, Inc > > # Licensed under the Apache License, Version 2.0 (the "License"); > # you may not use this file except in compliance with the License. > # You may obtain a copy of the License at > > # http://www.apache.org/licenses/LICENSE-2.0 > > # Unless required by applicable law or agreed to in writing, software > # distributed under the License is distributed on an "AS IS" BASIS, > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= . > # See the License for the specific language governing permissions and > # limitations under the License. > > # Makefile for BitKeeper. > > # Bitmover makefiles try to provide the following targets: > # > # all build everything under the current directory > # > # clean remove all objects and programs > # > # clobber run clean plus 'bk -r. clean' > # > # srcs bk get all sources in current directory > # > # tags build ctags for all srcs (only needed in this (top) > makefile) > # > # tags.local build ctags for srcs under current directory relative to > top > # > #--- > # Special make variables commonly used this makefile: > # $@ target > # $^ all sources > # $< first source > > INSTALLED_BK ?=3D $(shell bash -c "cd / && command -v bk") > INREPO ?=3D $(shell bash -c "test -d ../.bk && echo true || echo false") > HERE :=3D $(shell pwd) > ROOT :=3D $(shell dirname $(HERE)) > REPO :=3D $(notdir $(ROOT)) > URL :=3D $(shell echo bk://work/$(ROOT) | sed s,/home/bk/,,) > LOG =3D $(shell echo LOG-`bk getuser`) > OSTYPE :=3D $(shell bash -c 'echo $$OSTYPE') > > include conf.mk > > ## Which hosts are used for producing nightly builds > NIGHTLY_HOSTS :=3D macos106 win7-vm debian40 debian40-64 > > ifeq "$(OSTYPE)" "msys" > SYS=3Dwin32 > EXE=3D.exe > XTRA=3Dwin32 > ifeq (,$(INSTALLED_BK)) > # BINDIR should really be :C:/Program Files/BitKeeper > # The shell can not handle space in pathname, so > # we use the short name here > BINDIR :=3D "C:/PROGRA~1/BITKEE~1" > else > BINDIR :=3D $(shell bk pwd -s "`bk _registry get > 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion' > ProgramFilesDir`/BitKeeper") > endif > INSTALL=3Dinstalldir > RESOURCE=3Dbkres.o > UWT_C=3D$(patsubst %,win32/uwtlib/%.c, wapi_intf wcrt_intf) > BKGUI=3Dbkg$(EXE) > BKG_O=3Dbkg.o > else > SYS=3Dunix > EXE=3D > # You can set this to anywhere you like and do a > # build production" and you'll have an installed BitKeeper. > ifeq (,$(INSTALLED_BK)) > BINDIR :=3D /usr/local/bitkeeper > else > BINDIR :=3D $(shell "$(INSTALLED_BK)" bin) > endif > INSTALL=3Dinstall > RESOURCE=3D > endif > > # By default, we don't print verbose output. If you want to see > # the full compiler command line, use 'make V=3D1' > # The trick is to do "$(Q)$(CC)" instead of just "$(CC)" so that if > # Q is not set, it's just "$(CC)" and if Q is set to @ it becomes > # a quiet "@$(CC)". > # For the verbose messages, gmake provides > # $(if $(Q),,) > # so we just conditionalize on Q. Empty is false. > ifndef V > Q=3D@ > export Q > endif > > BK=3D./bk$(EXE) > G =3D-g > TRIAL =3D0 > IMGDIR =3D$(HERE)/tmp/bitkeeper > > # Handle warning arguments in GCC > # > # -Wall enables a bunch of warnings by default > # -Wno-parentheses shuts up "suggest parentheses around assignment ...". > # Unfortunately it also turns off dangling else warnings. > # -Wno-char-subscripts shuts up "subscript has type char", which comes > # up all the time with broken implementations. > # (renabled in GCC3 since it supresses warnings in system files by > default) > # -Wno-format-y2k supresses complains about '%y' in strftime formats > # -Wstrict-prototypes Don't allow non-ansi function declarations > WARNINGS=3D-Wall -Wno-parentheses -Wno-char-subscripts -Wno-format-y2k \ > -Wstrict-prototypes > > # Warnings enabled with GCC newer than 3.0 > # > # -Wredundant-decls Declaring same function twice > # -Wmissing-declarations Functions without a prototype > WARNINGS_GCC3=3D-Wchar-subscripts -Wredundant-decls -Wmissing-declaration= s > > # Warnings enabled with GCC newer than 4.0 > # > # -Wextra enable a bunch of random things (called -Wextra in newer gccs) > # -Wno-pointer-sign Suppress warnings about changing the signs of pointe= rs > # -Wno-sign-compare Suppress warnings about comparing signed and unsigne= d > vars > # -Wno-unsed-parameter Support warnings about function parameters that ar= e > # no used > # -Wno-missing-field-initializers > # -Wdeclaration-after-statement Warn if someone does a C++ thing of > declaring > # a variable in the middle of a block > WARNINGS_GCC4=3D-Wextra -Wno-pointer-sign -Wno-sign-compare \ > -Wno-unused-parameter -Wno-missing-field-initializers \ > -Wdeclaration-after-statement -Wpointer-arith > > # Warnings enabled with GCC newer than 5.0 > # > # -Wno-unusedr-esult Do not warn if a caller ignores return value > WARNINGS_GCC5=3D-Wno-unused-result > > WARNINGS_GCC6=3D -Wno-misleading-indentation > > # XXX could not get -Wimplicit-fallthrough=3D3 to work > WARNINGS_GCC7=3D -Wno-implicit-fallthrough > > # Other options to consider enabling in the future: > # > # -Wnested-externs Prototypes declared in a function > # -Wwrite-string warn in string constant is passed to a char * > # -Wmissing-prototypes > # -Wunused-parameter > # -Wold-style-definition Would be nice, but zlib falls all over here > > GCC_MAJOR_REV=3D$(shell $(CC) -dumpversion | sed 's/\..*//') > GCC_MINOR_REV=3D$(shell $(CC) -dumpversion | sed 's/.*\.//') > ifeq ($(GCC_MAJOR_REV),3) > WARNINGS +=3D $(WARNINGS_GCC3) > endif > ifeq ($(GCC_MAJOR_REV),4) > WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4) > ifeq ($(shell expr $(GCC_MINOR_REV) \> 5), 1) > WARNINGS +=3D -Wno-unused-result > endif > endif > ifeq ($(GCC_MAJOR_REV),5) > WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4) $(WARNINGS_GCC5) > endif > ifeq ($(GCC_MAJOR_REV),6) > WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4) $(WARNINGS_GCC5) = \ > $(WARNINGS_GCC6) > endif > ifeq ($(GCC_MAJOR_REV),7) > WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4) $(WARNINGS_GCC5) = \ > $(WARNINGS_GCC6) $(WARNINGS_GCC7) > endif > ifeq ($(GCC_MAJOR_REV),8) > WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4) $(WARNINGS_GCC5) = \ > $(WARNINGS_GCC6) $(WARNINGS_GCC7) $(WARNINGS_GCC8) > endif > > TRACE =3D -DUSE_TRACE > > ifeq ($(shell uname -s), Darwin) > XLIBS +=3D -lresolv > G +=3D -DNOPROC > endif > > ifeq (clang, $(findstring clang, $(shell $(CC) --version))) > WARNINGS +=3D -Wno-unused-value -Wno-empty-body -Wno-self-assign > endif > > GCCOPTS=3D > CC_DEBUG=3D$(GCCOPTS) $G $(WARNINGS) $(TRACE) > CC_FAST_DEBUG=3D$(GCCOPTS) $G -O2 $(WARNINGS) $(TRACE) > CC_FAST =3D$(CC_FAST_DEBUG) > CC_WALL=3D$(GCCOPTS) $G -DLINT $(WARNINGS) $(TRACE) > BINS =3D $(BK) $(BKGUI) > > # List of all objects in bk other than bk.o. Keep it sorted. > # But put bkver.o/cmd.o first, they generate headers. > OBJ =3D bkver.o cmd.o \ > abort.o adler32.o alias.o admin.o annotate.o attributes.o \ > bam.o bisect.o bkd.o bkd_bam.o bkd_cd.o \ > bkd_changes.o bkd_client.o bkd_clone.o bkd_cmdtab.o \ > bkd_findkey.o bkd_http.o \ > bkd_id.o bkd_kill.o bkd_level.o bkd_misc.o bkd_nested.o \ > bkd_partition.o bkd_pull.o bkd_push.o bkd_pwd.o \ > bkd_r2c.o \ > bkd_rclone.o bkd_rootkey.o bkd_status.o bkd_synckeys.o > bkd_version.o \ > bkverinfo.o \ > cat.o cfile.o changes.o config.o \ > check.o checksum.o clean.o cleanpath.o clone.o \ > cmdlog.o \ > collapse.o comment.o comments.o commit.o comps.o compress.o \ > contrib/cat.o \ > contrib/test.o \ > converge.o \ > cp.o \ > crypto.o \ > cset.o cset_inex.o csetprune.o csets.o cweave.o \ > dataheap.o dbfile.o delta.o diff.o dspec.o \ > export.o \ > fast-import.o fast-export.o features.o findmerge.o \ > find.o findcset.o fixtool.o fsl.o fslayer.o \ > g2bk.o gca.o get.o gethelp.o \ > gethost.o gettemp.o getuser.o gfiles.o glob.o \ > gnupatch.o graft.o grep.o \ > hash_nokey.o \ > heapdump.o help.o here.o here_check.o hostme.o http.o \ > idcache.o isascii.o info.o \ > key2rev.o key2path.o kill.o kv.o \ > libcommit.o libdiff.o libgraph.o librange.o \ > libsfiles.o lines.o \ > localtm.o lock.o locking.o \ > mail.o merge.o mklock.o \ > mailslot.o \ > mtime.o mv.o names.o ndiff.o nested.o newroot.o \ > opark.o \ > parent.o park.o partition.o \ > patch.o \ > pending.o preference.o proj.o \ > poly.o \ > populate.o \ > port/bkd_server.o \ > port/check_rsh.o \ > port/gethomedir.o \ > port/gethost.o port/getinput.o \ > port/getrealname.o port/getrusage.o port/globalroot.o port/gui.o = \ > port/hostColonPath.o port/http_proxy.o \ > port/mail.o port/mnext.o port/networkfs.o \ > port/notifier.o port/ns_sock_host2ip.o port/platforminit.o \ > port/sccs_getuser.o port/sccs_lockfile.o \ > port/startmenu.o \ > port/svcinfo.o \ > port/uninstall.o \ > progress.o \ > prs.o pull.o push.o pwd.o \ > randombits.o randseed.o range.o rcheck.o rclone.o \ > rcs2bk.o rcsparse.o \ > receive.o redblack.o regex.o registry.o renumber.o \ > remap.o remote.o \ > repo.o repos.o repogca.o repostats.o repotype.o \ > resolve.o resolve_binaries.o resolve_contents.o \ > resolve_create.o resolve_filetypes.o \ > resolve_flags.o resolve_generic.o resolve_modes.o \ > resolve_renames.o resolve_tags.o restore.o review.o \ > rm.o rmdel.o rmgone.o \ > root.o rset.o sane.o scat.o sccs.o sccs2bk.o \ > sccslog.o sccs_mv.o search.o sec2hms.o send.o sendbug.o \ > set.o setup.o sfio.o shrink.o sinfo.o \ > slib.o smerge.o sort.o startmenu.o \ > stat.o stattest.o status.o stripdel.o synckeys.o \ > tagmerge.o testcode.o tclsh.o takepatch.o \ > testdates.o time.o timestamp.o touch.o trigger.o \ > unbk.o undo.o undos.o unedit.o \ > unique.o uninstall.o unlink.o unlock.o unpull.o unrm.o unwrap.o > upgrade.o \ > urlinfo.o \ > utils.o uu.o what.o which.o \ > xfile.o xflags.o \ > zone.o > SCRIPTS =3D bk.script import \ > uuwrap unuuwrap gzip_uuwrap ungzip_uuwrap \ > b64wrap unb64wrap gzip_b64wrap ungzip_b64wrap > PSCR =3D t/doit t/guitest > PROGS =3D libc/mtst$(EXE) > LIBS =3D libc/libc.a > DATA =3D bkmsg.txt bkhelp.txt version \ > ../doc/bk_refcard.ps ../doc/bk_refcard.pdf ../RELEASE-NOTES.md \ > dspec-changes dspec-changes-3.2 dspec-changes-4.0 dspec-changes-h= \ > dspec-changes-hv dspec-changes-json dspec-changes-json-v \ > dspec-changes-vv dspec-log dspec-prs > > CONTRIB =3D gui/ide/emacs/vc-bk.el contrib/git2bk.l > ALL =3D PCRE $(LIBS) $(BINS) $(SCRIPTS) $(PSCR) $(XTRA) \ > $(PROGS) L-clean GUI L-doc $(DATA) > > CFLAGS =3D $(CC_DEBUG) > export CFLAGS > CPPFLAGS=3D -Ilibc $(TOMCRYPT_CPPFLAGS) $(TOMMATH_CPPFLAGS) \ > $(PCRE_CPPFLAGS) $(LZ4_CPPFLAGS) $(ZLIB_CPPFLAGS) > # Override this if you don't have it. > RANLIB =3D ranlib > > # list of C sources in bk > SRCS =3D bk.c $(OBJ:.o=3D.c) > # list of headers in bk > HDRS =3D bam.h bkd.h bk-features.h config.h configvars.def diff.h > fsfuncs.h \ > graph.h nested.h \ > progress.h range.h rcs.h resolve.h sccs.h \ > cmd.h poly.h proj.h redblack.h libc/system.h xfile.h > > # list of non-C sources in bk > SCRSRCS =3D bk.sh import.sh kwextract.pl uuwrap.sh unuuwrap.sh \ > port/unix_platform.sh port/win32_platform.sh \ > gzip_uuwrap.sh ungzip_uuwrap.sh \ > substvars.sh b64wrap.sh gzip_b64wrap.sh \ > unb64wrap.sh ungzip_b64wrap.sh > MISC =3D bkmsg.doc t/doit.sh > > default: > $(MAKE) p > > SUBDIRS =3D libc $(shell ls -d tomcrypt tommath 2>/dev/null) > > all: $(ALL) > > prof: > $(MAKE) CFLAGS=3D"$G -pg -O2" LDFLAGS=3D-pg all > gprof: > $(MAKE) CFLAGS=3D"$G -DPROFILE -pg -O2" LDFLAGS=3D-pg all > ggprof: > $(MAKE) CFLAGS=3D"$G -DPROFILE -pg" LDFLAGS=3D-pg all > # Debugging... > d: > $(MAKE) CFLAGS=3D"$G -DDEBUG" all > debug: > $(MAKE) CFLAGS=3D"$G -DDEBUG" all > debug2: > $(MAKE) CFLAGS=3D"$G -DDEBUG2" all > > gWall Wall: > $(MAKE) CFLAGS=3D"$(CC_WALL)" all > > # production builds > p: ## Build a production version of BitKeeper (no -g) > $(MAKE) CFLAGS=3D"$(CC_FAST) $(CF)" all > > trial: > $(MAKE) TRIAL=3D"3*WEEK" CFLAGS=3D"$(CC_FAST) $(CF)" all > > trial3M: > $(MAKE) TRIAL=3D"3*MONTH" CFLAGS=3D"$(CC_FAST) $(CF)" all > > g: ## Build a debug version of BitKeeper (-g) > $(MAKE) CFLAGS=3D"$(CC_DEBUG)" all > gO: > $(MAKE) CFLAGS=3D"$(CC_FAST_DEBUG)" all > gcov: > $(MAKE) CFLAGS=3D"$(CC_DEBUG) -fprofile-arcs -ftest-coverage" all > > clean: L-clean FORCE ## Remove object files and executables > $(if $(Q),@echo Cleaning up,) > $(Q)for sub in $(SUBDIRS) ../doc ../man gui utils win32 t t/win32= ; > \ > do $(MAKE) -C$$sub "CFLAGS=3D$(CFLAGS)" $@; \ > done > $(Q)$(RM) $(OBJ) bk.o $(BKG_O) $(BINS) $(SCRIPTS) \ > $(PSRC) $(PROGS) > $(Q)$(RM) tags TAGS tags.local cscope.out substvars a.out cmd.c > cmd.h \ > core *.bb *.bbg *.da *.gcov \ > bk.ico \ > bkmsg.txt bkhelp.txt bkver.c version \ > t/doit t/guitest kw2val_lookup.c bkres.o svcmgr.exe \ > conf.mk > $(Q)$(RM) -r tmp > ifeq "$(OSTYPE)" "msys" > $(Q)$(RM) -rf gnu/bin gnu/doc gnu/etc gnu/share > $(Q)$(RM) -f gnu/m.ico gnu/msys.bat gnu/msys.ico > $(Q)-rmdir gnu/tmp > $(Q)-rmdir gnu > endif > ifeq (true,$(INREPO)) > ifneq (,$(INSTALLED_BK)) > $(Q)EXTRALIST=3D`"$(INSTALLED_BK)" -Aax | \ > grep -v '~$$\|conf-.*\.mk$$'` ; \ > if [ "$$EXTRALIST" ]; then \ > echo "Clean left behind the following files:" ; \ > for file in $$EXTRALIST; do \ > echo " $$file" ; \ > done ; \ > else \ > echo Clean complete ; \ > fi > endif > endif > > clobber: clean FORCE ## Same as 'clean' but also bk clean files > -@$(BK) -A clean > > # XXX subdirs? (see tags) > wc: $(HDRS) $(SRCS) $(SCRSRCS) $(MISC) > wc -l $(SRCS) $(HDRS) $(SCRSRCS) $(MISC) > > get-e: FORCE > -@$(BK) edit -qT `echo $(HDRS) $(SRCS) $(SCRSRCS) $(MISC) | fmt > -1|sort -u` > $(Q)$(MAKE) tags > > srcs: $(SRCS) $(HDRS) FORCE > $(Q)for sub in $(SUBDIRS); do $(BK) -r$$sub co -q; done > > tags: $(patsubst %,%/tags.local, $(SUBDIRS)) tags.local > @if [ -x $(BK) ]; \ > then $(BK) get -Sq tags.skippats; \ > $(BK) _sort -u $^ | grep -v -ftags.skippats > $@; \ > else \ > bk get -Sq tags.skippats; \ > bk _sort -u $^ | grep -v -ftags.skippats > $@; \ > fi > @echo ctags completed > > tags.local: $(SRCS) $(HDRS) > @ctags -f $@ --file-tags=3Dyes --c-types=3Dd+f+s+t $^ > > %/tags.local: FORCE > $(Q)$(MAKE) -C $(dir $@) tags.local > > ssh sshtest: > $(MAKE) realtest > > rsh rshtest: > PREFER_RSH=3DYES $(MAKE) realtest > > test tests: > DO_REMOTE=3DNO $(MAKE) -C t > > nonet nonet_test localtest: > BK_NONET=3DYES PREFER_RSH=3DYES $(MAKE) realtest > > realtest: $(ALL) t/doit > -cd gui/tcltk && $(MAKE) clobber > -$(BK) get -qS t/setup t/win32/win32_common > $(BK) -rt get -qTS 't.*' > cd t && ./doit -f 5 > > guitest: $(ALL) t/doit > -$(BK) get -qS t/SCCS/s.g.* t/setup t/win32/win32_common > t/guitest.tcl > cd t && ./doit -g -i > > t/doit: t/doit.sh substvars > ./substvars t/doit.sh > t/doit > chmod +x t/doit > > t/guitest: t/guitest.tcl > cat < t/guitest.tcl > t/guitest > > .PHONY: FORCE > FORCE: > > win32: FORCE > cd win32 && $(MAKE) BINDIR=3D$(BINDIR) > cd t/win32 && $(MAKE) > > # build libraries in sub directories > %.a: FORCE > $(Q)$(MAKE) -C $(dir $@) $(notdir $@) > > libc/mtst$(EXE): libc/libc.a FORCE > $(Q)$(MAKE) -C libc mtst$(EXE) > > bkres.o: win32/data/bk.rc bk.ico > windres -i win32/data/bk.rc -o bkres.o > > bk.ico: win32/data/bk.ico > @cp -f win32/data/bk.ico . > > ifneq ($(TOMCRYPT_SYSTEM),1) > # add dependency on building libraries first > $(BK): $(TOMCRYPT_LDFLAGS) > endif > ifneq ($(TOMMATH_SYSTEM),1) > # add dependency on building libraries first > $(BK): $(TOMMATH_LDFLAGS) > endif > > $(BK): $(LIBS) bk.o $(RESOURCE) $(OBJ) > $(if $(Q),@echo LINKING $(BK),) > $(Q)$(LD) $(LDFLAGS) -o $@ bk.o $(OBJ) $(RESOURCE) $(LIBS) \ > $(TOMCRYPT_LDFLAGS) $(TOMMATH_LDFLAGS) \ > $(PCRE_LDFLAGS) $(LZ4_LDFLAGS) $(ZLIB_LDFLAGS) $(XLIBS) > > # Windows only rule, BKGUI should be blank on other platforms > $(BKGUI): bkg.o $(RESOURCE) > $(if $(Q),@echo LINKING $(BKGUI),) > $(Q)$(LD) $(LDFLAGS) -o $@ bkg.o $(RESOURCE) -Llibc -lc -mwindows > $(XLIBS) > > bk.script: bk.sh port/$(SYS)_platform.sh > cat port/$(SYS)_platform.sh bk.sh > bk.script > chmod +x bk.script > > bkmsg.txt: bkmsg.doc > cp -f $< $@ > > L-clean: FORCE > @rm -f gui/share/doc/L/little.man ../man/man1/bk-little.1 > @rm -f ../man/man2help/bk-little-1.fmt > > # has to run before bkhelp.txt but after GUI > L-doc L-docs: GUI FORCE > @test -f gui/share/doc/L/little.man || { \ > echo Failed to build gui/share/doc/L/little.man; \ > exit 1; \ > } > @if [ -s gui/share/doc/L/little.man ]; \ > then cp gui/share/doc/L/little.man ../man/man1/bk-little.1; \ > else cp ../man/man1/bk-little.1.pfmt ../man/man1/bk-little.1; = \ > fi; \ > chmod +w ../man/man1/bk-little.1 > > bkhelp.txt: $(BK) version L-docs FORCE > @rm -f ../man/man2help/bk-little.fmt > @cd ../man/man2help && $(MAKE) BK=3D$(HERE)/bk$(EXE) helptxt > @cp ../man/man2help/helptxt bkhelp.txt > @rm -f ../man/man1/bk-little.1 > > html-docs: bkhelp.txt > @cd ../man/man2html && $(MAKE) > > ../doc/bk_refcard.ps: $(BK) FORCE > $(Q)echo building $@ > $(Q)-$(BK) -r../doc co -qS > $(Q)$(MAKE) -C ../doc BK=3D$(HERE)/bk$(EXE) all > > ../doc/bk_refcard.pdf: ../doc/bk_refcard.ps > > # This must be rebuilt every time because it includes the build time > bkver.c: utils/bk_version FORCE > $(if $(Q),@echo Building $@,) > $(Q)echo "#include \"sccs.h\"" > bk.v > $(Q)echo "char *bk_platform =3D \""`./utils/bk_version`"\";" >> b= k.v > $(Q)echo "int test_release =3D "$(TRIAL)";" >> bk.v > $(Q)echo "time_t bk_build_timet =3D "`perl -e "print time"`";" >> > bk.v > $(Q)echo "char *bk_build_dir =3D \""`pwd`"\";" >> bk.v > $(Q)mv -f bk.v bkver.c > > version: version.sh $(BK) utils/bk_version GUI FORCE > bash version.sh > $@ > > %: %.sh > $(if $(Q),@echo Building $@,) > $(Q)$(RM) $@ > $(Q)cp $< $@ > $(Q)chmod +x $@ > > %: %.l > $(if $(Q),@echo Not lexing $@,) > > import: import.sh port/$(SYS)_platform.sh > cat port/$(SYS)_platform.sh import.sh > import.T > chmod +x import.T > mv -f import.T import > > # Quick and dirty target so we can make all the gui tools without the res= t > .PHONY: GUI > GUI: PCRE $(BK) > @$(MAKE) -Cgui BK=3D$(HERE)/bk$(EXE) gui > > install: installdir > tmp/bitkeeper/bk _install -d -f $(DESTDIR)$(BINDIR) > @echo BitKeeper is installed in $(BINDIR) > @echo We suggest you run: > @echo > @echo sudo $(BINDIR)/bk links /usr/local/bin > @echo > @echo to create the bk symlink. > > installdir: utils/registry.tcl > rm -rf $(IMGDIR) || exit 1 > mkdir -p $(IMGDIR)/contrib > mkdir -p $(IMGDIR)/lscripts > -$(BK) -rwww get -S > -cp -f -r www $(IMGDIR) > -$(BK) get -S $(CONTRIB) > tar cf - $(BINS) $(SCRIPTS) lscripts gui/bin gui/lib gui/images \ > | (cd $(IMGDIR) && tar xf -) > cp -f $(DATA) $(IMGDIR) > cp -f $(CONTRIB) $(IMGDIR)/contrib > (cd ../doc/nested && $(MAKE) install HTML=3D$(IMGDIR)/html) > if [ $(SYS) =3D unix ]; \ > then $(BK) get -S ../man/Makefile; \ > cd ../man && $(MAKE) install BINDIR=3D$(IMGDIR) ;\ > else \ > (cd win32 && $(MAKE) BINDIR=3D$(IMGDIR) install); \ > cp utils/registry.tcl $(IMGDIR)/gui/lib; \ > fi > cd $(IMGDIR); \ > find . -type l | \ > perl -ne 'chomp; $$a =3D readlink; print > "$$a|$$_\n";'>symlinks; \ > test -s symlinks || rm -f symlinks > @true > > image: ## Build the installer (left in src/utils/bk-*) > $(MAKE) p > $(MAKE) _image > > _image: > $(MAKE) installdir > ${MAKE} -Cutils BINDIR=3D$(IMGDIR) "CC=3D$(CC)" "BK=3D$(HERE)/bk$= (EXE)" > "CFLAGS=3D$(CFLAGS)" image > > crankturn: crank.sh remote.sh ## Run a clean-build + regressions in > cluster > REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh LOG=3D$(LOG) bash = crank.sh > > cranksave: crank.sh remote.sh ## Run a crankturn but save the built imag= es > REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh LOG=3D$(LOG) bash = crank.sh > save > > crankstatus: crank.sh remote.sh ## See how the crank is going > REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh LOG=3D$(LOG) bash = crank.sh > status > > crankrelease nightly: $(BK) crank.sh remote.sh ## Do a BitKeeper release > (or nightly build) > @(TAG=3D$(shell $(BK) changes -r+ -d:TAG:) ; \ > test x$$TAG =3D x && { \ > echo Cannot crankrelease with a non-tagged tip ; \ > exit 1 ; \ > } ; \ > case $@ in \ > crankrelease ) \ > TYPE=3Drelease; DIR=3D/home/bk/images/$$TAG; \ > ;; \ > nightly ) \ > TYPE=3Dnightly; DIR=3D/home/bk/images/nightly; \ > HOSTS=3D"$(NIGHTLY_HOSTS)" ; \ > ;; \ > esac ; \ > test -d $$DIR || mkdir -p $$DIR ; \ > REPO=3D$(REPO) URL=3D$(URL) HOSTS=3D$$HOSTS REMOTE=3Dremote.sh \ > LOG=3D$(LOG) bash crank.sh $$TYPE ; \ > $(BK) -R get -qS ../RELEASE-NOTES.md ; \ > cp ../RELEASE-NOTES.md $$DIR ; \ > SAVED_WD=3D$(shell pwd) ; \ > cd $$DIR && chmod +rx bk-* >/dev/null 2>&1 ; \ > rm -f MD5SUMS ; \ > md5sum bk-* >> MD5SUMS ; \ > echo "Your images are in $$DIR" ; \ > case $@ in \ > crankrelease ) \ > echo "Run './mkrelease $$TAG' to release this version of > bk."; \ > ;; \ > nightly ) \ > # cd $$SAVED_WD ; \ > # ./mkupgrades --nightly $$TAG ; \ > ;; \ > esac) > > crankclean: crank.sh remote.sh > REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh LOG=3D$(LOG) bash = crank.sh > clean > > # This target assumes a bk repository > .PHONY: src-tar > src-tar: $(BK) version ## build tar.gz image for the current tree > ifeq (false,$(INREPO)) > $(error This target only works in a BK source repository) > else > ./bk here add default TCLTK > $(Q)-mkdir -p tmp/src > $(Q)(DIR=3Dbk-$(shell $(BK) version -s) ; \ > TAR=3D"$$DIR".tar.gz ; \ > echo "Creating $$TAR in tmp/src..." ; \ > cd tmp/src ; \ > rm -rf "$$DIR" ; \ > ../../bk export -tplain -kwr+ -sdefault -sTCLTK "$$DIR" ; \ > cat ../../version > "$$DIR/src/bkvers.txt" ; \ > tar -czf "$$TAR" "$$DIR" ; \ > rm -rf "$$DIR" ; \ > echo Done ; \ > ) > endif > > # only depend on conf.mk.local if it exists > conf.mk: mkconf.sh $(wildcard conf.mk.local) > sh mkconf.sh > $@ || { $(RM) $@; false; } > > %.o: %.c > $(if $(Q),@echo CC $<,) > $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ > > port/startmenu.o: port/startmenu.c $(HDRS) > $(if $(Q),@echo CC $<,) > $(Q)$(CC) $(CFLAGS) -fno-strict-aliasing $(CPPFLAGS) -c $< -o $@ > > depend: $(SRCS) > $(CC) -MM -MG -D_DEPEND $(SRCS) > depends > > # for system.h we need to actually run libc's makefile because it include= s > # calculated header files > libc/system.h: FORCE > $(MAKE) -C libc system.h > > libc/libc.a: libc/system.h > > sccs.h: PCRE > .PHONY: PCRE > PCRE: > ifneq ($(PCRE_SYSTEM),1) > $(MAKE) -Cgui/tcltk pcre > endif > > $(OBJ) bk.o: $(HDRS) > > cmd.c cmd.h: cmd.pl bk.sh $(filter bkd_%,$(SRCS)) > $(if $(Q),@echo Building $@,) > $(Q)perl cmd.pl || (rm -f cmd.c cmd.h; exit 1) > > # This parses slib.c and extracts the meta-data keywords expanded > # by kw2val() and passes them to gperf to generate hash lookup code. > slib.o: kw2val_lookup.c > kw2val_lookup.c: slib.c kw2val.pl > $(if $(Q),@echo Building $@,) > $(Q)perl kw2val.pl slib.c || (rm -f kw2val_lookup.c; exit 1) > > check-syntax: > $(CC) $(CFLAGS) $(CPPFLAGS) -c -S ${CHK_SOURCES} -o /dev/null > > # print a make variable 'make print-REPO' > # http://www.cmcrossroads.com/article/printing-value-makefile-variable > print-%: > @echo $* =3D \"$($*)\" > > .PHONY: help > > help: > @grep -E -h '^[-a-zA-Z_\ ]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | > awk 'BEGIN {FS =3D ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, = $$2}' > @echo Suggested: make -j12 image > > --0000000000003c4553061b3f3c67 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Jun 19, 2024, 7:28=E2=80=AFAM Larry McVoy <= lm@mcvoy.com> wrote:
On Tue, Jun 18, 2024 at 07:46:15PM -0500, Nevin Li= ber wrote:
> But I'll bite.=C2=A0 There was the claim by Larry McVoy that "= ;Writing Makefiles
> isn't that hard".
>
> Please show these beautiful makefiles for a non-toy non-trivial produc= t

Works on *BSD, MacOS, Windows, Linux on a bunch of different architectures,=
Solaris, HPUX, AIX, IRIX, Tru64, etc.

The posted Makefile is no a strictly = conforming POSIX Makefile, but uses gmake extensions extensively... And eye= s of the beholder may vary...

Warner

# Copyright 1999-2016 BitMover, Inc

# Licensed under the Apache License, Version 2.0 (the "License");=
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#=C2=A0 =C2=A0 =C2=A0http://www.apache.org/lice= nses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASI= S,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<= br> # See the License for the specific language governing permissions and
# limitations under the License.

# Makefile for BitKeeper.

# Bitmover makefiles try to provide the following targets:
#
# all=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0build everything under the cu= rrent directory
#
# clean=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0remove all objects and programs #
# clobber=C2=A0 =C2=A0 =C2=A0 =C2=A0run clean plus 'bk -r. clean' #
# srcs=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bk get all sources in current dire= ctory
#
# tags=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 build ctags for all srcs (only nee= ded in this (top) makefile)
#
# tags.local=C2=A0 =C2=A0 build ctags for srcs under current directory rela= tive to top
#
#---
# Special make variables commonly used this makefile:
#=C2=A0 =C2=A0$@=C2=A0 target
#=C2=A0 =C2=A0$^=C2=A0 all sources
#=C2=A0 =C2=A0$<=C2=A0 first source

INSTALLED_BK=C2=A0 =C2=A0 ?=3D $(shell bash -c "cd / && comman= d -v bk")
INREPO=C2=A0 ?=3D $(shell bash -c "test -d ../.bk && echo true= || echo false")
HERE=C2=A0 =C2=A0 :=3D $(shell pwd)
ROOT=C2=A0 =C2=A0 :=3D $(shell dirname $(HERE))
REPO=C2=A0 =C2=A0 :=3D $(notdir $(ROOT))
URL=C2=A0 =C2=A0 =C2=A0:=3D $(shell echo bk://work/$(ROOT) | sed s,/home/bk= /,,)
LOG=C2=A0 =C2=A0 =C2=A0=3D $(shell echo LOG-`bk getuser`)
OSTYPE=C2=A0 :=3D $(shell bash -c 'echo $$OSTYPE')

include conf.mk

## Which hosts are used for producing nightly builds
NIGHTLY_HOSTS=C2=A0 =C2=A0:=3D macos106 win7-vm debian40 debian40-64

ifeq "$(OSTYPE)" "msys"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SYS=3Dwin32
=C2=A0 =C2=A0 =C2=A0 =C2=A0 EXE=3D.exe
=C2=A0 =C2=A0 =C2=A0 =C2=A0 XTRA=3Dwin32
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ifeq (,$(INSTALLED_BK))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # BINDIR should rea= lly be :C:/Program Files/BitKeeper
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # The shell can not= handle space in pathname, so
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # we use the short = name here
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BINDIR :=3D "C= :/PROGRA~1/BITKEE~1"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BINDIR :=3D $(shell= bk pwd -s "`bk _registry get 'HKEY_LOCAL_MACHINE\SOFTWARE\Microso= ft\Windows\CurrentVersion' ProgramFilesDir`/BitKeeper")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 INSTALL=3Dinstalldir
=C2=A0 =C2=A0 =C2=A0 =C2=A0 RESOURCE=3Dbkres.o
=C2=A0 =C2=A0 =C2=A0 =C2=A0 UWT_C=3D$(patsubst %,win32/uwtlib/%.c, wapi_int= f wcrt_intf)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 BKGUI=3Dbkg$(EXE)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 BKG_O=3Dbkg.o
else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SYS=3Dunix
=C2=A0 =C2=A0 =C2=A0 =C2=A0 EXE=3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 # You can set this to anywhere you like and do = a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 # build production" and you'll have an= installed BitKeeper.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ifeq (,$(INSTALLED_BK))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BINDIR :=3D /usr/lo= cal/bitkeeper
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BINDIR :=3D $(shell= "$(INSTALLED_BK)" bin)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 INSTALL=3Dinstall
=C2=A0 =C2=A0 =C2=A0 =C2=A0 RESOURCE=3D
endif

# By default, we don't print verbose output. If you want to see
# the full compiler command line, use 'make V=3D1'
# The trick is to do "$(Q)$(CC)" instead of just "$(CC)"= ; so that if
# Q is not set, it's just "$(CC)" and if Q is set to @ it bec= omes
# a quiet "@$(CC)".
# For the verbose messages, gmake provides
# $(if $(Q),<then>,<else>)
# so we just conditionalize on Q. Empty is false.
ifndef V
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Q=3D@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 export Q
endif

BK=3D./bk$(EXE)
G=C2=A0 =C2=A0 =C2=A0 =C2=A0=3D-g
TRIAL=C2=A0 =C2=A0=3D0
IMGDIR=C2=A0 =3D$(HERE)/tmp/bitkeeper

# Handle warning arguments in GCC
#
# -Wall enables a bunch of warnings by default
# -Wno-parentheses shuts up "suggest parentheses around assignment ...= ".
#=C2=A0 Unfortunately it also turns off dangling else warnings.
# -Wno-char-subscripts shuts up "subscript has type char", which = comes
#=C2=A0 up all the time with broken <ctype.h> implementations.=C2=A0 =
#=C2=A0 (renabled in GCC3 since it supresses warnings in system files by de= fault)
# -Wno-format-y2k supresses complains about '%y' in strftime format= s
# -Wstrict-prototypes=C2=A0 =C2=A0 Don't allow non-ansi function declar= ations
WARNINGS=3D-Wall -Wno-parentheses -Wno-char-subscripts -Wno-format-y2k \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 -Wstrict-prototypes

# Warnings enabled with GCC newer than 3.0
#
# -Wredundant-decls=C2=A0 =C2=A0 =C2=A0 =C2=A0Declaring same function twice=
# -Wmissing-declarations=C2=A0 Functions without a prototype
WARNINGS_GCC3=3D-Wchar-subscripts -Wredundant-decls -Wmissing-declarations<= br>
# Warnings enabled with GCC newer than 4.0
#
# -Wextra=C2=A0 enable a bunch of random things (called -Wextra in newer gc= cs)
# -Wno-pointer-sign=C2=A0 Suppress warnings about changing the signs of poi= nters
# -Wno-sign-compare=C2=A0 Suppress warnings about comparing signed and unsi= gned vars
# -Wno-unsed-parameter Support warnings about function parameters that are =
#=C2=A0 no used
# -Wno-missing-field-initializers
# -Wdeclaration-after-statement Warn if someone does a C++ thing of declari= ng
#=C2=A0 a variable in the middle of a block
WARNINGS_GCC4=3D-Wextra -Wno-pointer-sign -Wno-sign-compare \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -Wno-unused-parameter -Wno-missing-field-initia= lizers \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -Wdeclaration-after-statement -Wpointer-arith
# Warnings enabled with GCC newer than 5.0
#
# -Wno-unusedr-esult Do not warn if a caller ignores return value
WARNINGS_GCC5=3D-Wno-unused-result

WARNINGS_GCC6=3D -Wno-misleading-indentation

# XXX could not get -Wimplicit-fallthrough=3D3 to work
WARNINGS_GCC7=3D -Wno-implicit-fallthrough

# Other options to consider enabling in the future:
#
# -Wnested-externs Prototypes declared in a function
# -Wwrite-string warn in string constant is passed to a char *
# -Wmissing-prototypes
# -Wunused-parameter
# -Wold-style-definition Would be nice, but zlib falls all over here

GCC_MAJOR_REV=3D$(shell $(CC) -dumpversion | sed 's/\..*//')
GCC_MINOR_REV=3D$(shell $(CC) -dumpversion | sed 's/.*\.//')
ifeq ($(GCC_MAJOR_REV),3)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3)
endif
ifeq ($(GCC_MAJOR_REV),4)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ifeq ($(shell expr $(GCC_MINOR_REV) \> 5), 1= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D -Wno-= unused-result
=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif
endif
ifeq ($(GCC_MAJOR_REV),5)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4)= $(WARNINGS_GCC5)
endif
ifeq ($(GCC_MAJOR_REV),6)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4)= $(WARNINGS_GCC5) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(WAR= NINGS_GCC6)
endif
ifeq ($(GCC_MAJOR_REV),7)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4)= $(WARNINGS_GCC5) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(WAR= NINGS_GCC6) $(WARNINGS_GCC7)
endif
ifeq ($(GCC_MAJOR_REV),8)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D $(WARNINGS_GCC3) $(WARNINGS_GCC4)= $(WARNINGS_GCC5) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(WAR= NINGS_GCC6) $(WARNINGS_GCC7) $(WARNINGS_GCC8)
endif

TRACE =3D -DUSE_TRACE

ifeq ($(shell uname -s), Darwin)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 XLIBS +=3D -lresolv
=C2=A0 =C2=A0 =C2=A0 =C2=A0 G=C2=A0 =C2=A0 =C2=A0 =C2=A0+=3D -DNOPROC
endif

ifeq (clang, $(findstring clang, $(shell $(CC) --version)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 WARNINGS +=3D -Wno-unused-value -Wno-empty-body= -Wno-self-assign
endif

GCCOPTS=3D
CC_DEBUG=3D$(GCCOPTS) $G $(WARNINGS) $(TRACE)
CC_FAST_DEBUG=3D$(GCCOPTS) $G -O2 $(WARNINGS) $(TRACE)
CC_FAST =3D$(CC_FAST_DEBUG)
CC_WALL=3D$(GCCOPTS) $G -DLINT $(WARNINGS) $(TRACE)
BINS=C2=A0 =C2=A0 =3D $(BK) $(BKGUI)

# List of all objects in bk other than bk.o. Keep it sorted.
# But put bkver.o/cmd.o first, they generate headers.
OBJ =3D=C2=A0 =C2=A0bkver.o cmd.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 abort.o adler32.o alias.o admin.o annotate.o at= tributes.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bam.o bisect.o bkd.o bkd_bam.o bkd_cd.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_changes.o bkd_client.o bkd_clone.o bkd_cmdt= ab.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_findkey.o bkd_http.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_id.o bkd_kill.o bkd_level.o bkd_misc.o bkd_= nested.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_partition.o bkd_pull.o bkd_push.o bkd_pwd.o= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_r2c.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkd_rclone.o bkd_rootkey.o bkd_status.o bkd_syn= ckeys.o bkd_version.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bkverinfo.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cat.o cfile.o changes.o config.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 check.o checksum.o clean.o cleanpath.o clone.o = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cmdlog.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 collapse.o comment.o comments.o commit.o comps.= o compress.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 contrib/cat.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 contrib/test.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 converge.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cp.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 crypto.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cset.o cset_inex.o csetprune.o csets.o cweave.o= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dataheap.o dbfile.o delta.o diff.o dspec.o \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 export.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fast-import.o fast-export.o features.o findmerg= e.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 find.o findcset.o fixtool.o fsl.o fslayer.o \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 g2bk.o gca.o get.o gethelp.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 gethost.o gettemp.o getuser.o gfiles.o glob.o \=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 gnupatch.o graft.o grep.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 hash_nokey.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 heapdump.o help.o here.o here_check.o hostme.o = http.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 idcache.o isascii.o info.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 key2rev.o key2path.o kill.o kv.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 libcommit.o libdiff.o libgraph.o librange.o \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 libsfiles.o lines.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 localtm.o lock.o locking.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mail.o merge.o mklock.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mailslot.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mtime.o mv.o names.o ndiff.o nested.o newroot.o= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 opark.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 parent.o park.o partition.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 patch.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 pending.o preference.o proj.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 poly.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 populate.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/bkd_server.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/check_rsh.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/gethomedir.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/gethost.o port/getinput.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/getrealname.o port/getrusage.o port/global= root.o port/gui.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/hostColonPath.o port/http_proxy.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/mail.o port/mnext.o port/networkfs.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/notifier.o port/ns_sock_host2ip.o port/pla= tforminit.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/sccs_getuser.o port/sccs_lockfile.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/startmenu.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/svcinfo.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 port/uninstall.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 progress.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 prs.o pull.o push.o pwd.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 randombits.o randseed.o range.o rcheck.o rclone= .o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 rcs2bk.o rcsparse.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 receive.o redblack.o regex.o registry.o renumbe= r.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 remap.o remote.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 repo.o repos.o repogca.o repostats.o repotype.o= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 resolve.o resolve_binaries.o resolve_contents.o= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 resolve_create.o resolve_filetypes.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 resolve_flags.o resolve_generic.o resolve_modes= .o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 resolve_renames.o resolve_tags.o restore.o revi= ew.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 rm.o rmdel.o rmgone.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 root.o rset.o sane.o scat.o sccs.o sccs2bk.o \<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 sccslog.o sccs_mv.o search.o sec2hms.o send.o s= endbug.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 set.o setup.o sfio.o shrink.o sinfo.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 slib.o smerge.o sort.o startmenu.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 stat.o stattest.o status.o stripdel.o synckeys.= o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tagmerge.o testcode.o tclsh.o takepatch.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 testdates.o time.o timestamp.o touch.o trigger.= o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 unbk.o undo.o undos.o unedit.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 unique.o uninstall.o unlink.o unlock.o unpull.o= unrm.o unwrap.o upgrade.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 urlinfo.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 utils.o uu.o what.o which.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xfile.o xflags.o \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 zone.o
SCRIPTS =3D bk.script import \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uuwrap unuuwrap gzip_uuwrap ungzip_uuwrap \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 b64wrap unb64wrap gzip_b64wrap ungzip_b64wrap PSCR=C2=A0 =C2=A0 =3D t/doit t/guitest
PROGS=C2=A0 =C2=A0=3D libc/mtst$(EXE)
LIBS=C2=A0 =C2=A0 =3D libc/libc.a
DATA=C2=A0 =C2=A0 =3D bkmsg.txt bkhelp.txt version \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ../doc/bk_refcard.ps ../doc/bk_refcar= d.pdf ../RELEASE-NOTES.md \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dspec-changes dspec-changes-3.2 dspec-changes-4= .0 dspec-changes-h \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dspec-changes-hv dspec-changes-json dspec-chang= es-json-v \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 dspec-changes-vv dspec-log dspec-prs

CONTRIB =3D gui/ide/emacs/vc-bk.el contrib/git2bk.l
ALL=C2=A0 =C2=A0 =C2=A0=3D PCRE $(LIBS) $(BINS) $(SCRIPTS) $(PSCR) $(XTRA) = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(PROGS) L-clean GUI L-doc $(DATA)

CFLAGS=C2=A0 =3D $(CC_DEBUG)
export CFLAGS
CPPFLAGS=3D -Ilibc $(TOMCRYPT_CPPFLAGS) $(TOMMATH_CPPFLAGS) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(PCRE_CPPFLAGS) $(LZ4_CPPFLAGS) $(ZLIB_CPPFLAG= S)
# Override this if you don't have it.
RANLIB=C2=A0 =3D ranlib

# list of C sources in bk
SRCS=C2=A0 =C2=A0 =3D bk.c $(OBJ:.o=3D.c)
# list of headers in bk
HDRS=C2=A0 =C2=A0 =3D bam.h bkd.h bk-features.h config.h configvars.def dif= f.h fsfuncs.h \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 graph.h nested.h \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 progress.h range.h rcs.h resolve.h sccs.= h \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cmd.h poly.h proj.h redblack.h libc/syst= em.h xfile.h

# list of non-C sources in bk
SCRSRCS =3D bk.sh import.sh kwextract.pl uuwrap.sh unuuwrap.sh \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 port/unix_platform.sh port/win32_platfor= m.sh \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 gzip_uuwrap.sh ungzip_uuwrap.sh \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 substvars.sh b64wrap.sh gzip_b64wrap.sh = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unb64wrap.sh ungzip_b64wrap.sh
MISC=C2=A0 =C2=A0 =3D bkmsg.doc t/doit.sh

default:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) p

SUBDIRS =3D libc $(shell ls -d tomcrypt tommath 2>/dev/null)

all: $(ALL)

prof:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -pg -O2" LDFLAGS= =3D-pg all
gprof:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -DPROFILE -pg -O2&quo= t; LDFLAGS=3D-pg all
ggprof:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -DPROFILE -pg" L= DFLAGS=3D-pg all
# Debugging...
d:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -DDEBUG" all
debug:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -DDEBUG" all
debug2:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$G -DDEBUG2" all
gWall Wall:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$(CC_WALL)" all

# production builds
p:=C2=A0 ## Build a production version of BitKeeper (no -g)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$(CC_FAST) $(CF)" a= ll

trial:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) TRIAL=3D"3*WEEK" CFLAGS=3D&qu= ot;$(CC_FAST) $(CF)" all

trial3M:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) TRIAL=3D"3*MONTH" CFLAGS=3D&q= uot;$(CC_FAST) $(CF)" all

g:=C2=A0 ## Build a debug version of BitKeeper (-g)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$(CC_DEBUG)" all gO:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$(CC_FAST_DEBUG)" a= ll
gcov:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) CFLAGS=3D"$(CC_DEBUG) -fprofile-ar= cs -ftest-coverage" all

clean: L-clean FORCE=C2=A0 ## Remove object files and executables
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Cleaning up,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)for sub in $(SUBDIRS) ../doc ../man gui uti= ls win32 t t/win32; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 do=C2=A0 =C2=A0 =C2=A0 $(MAKE) -C$$sub "CF= LAGS=3D$(CFLAGS)" $@; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 done
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) $(OBJ) bk.o $(BKG_O) $(BINS) $(SCRIPT= S) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(PSRC) $(PROGS)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) tags TAGS tags.local cscope.out subst= vars a.out cmd.c cmd.h \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 core *.bb *.bbg *.d= a *.gcov \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bk.ico \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bkmsg.txt bkhelp.tx= t bkver.c version \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 t/doit t/guitest kw= 2val_lookup.c bkres.o svcmgr.exe \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 conf.mk
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) -r tmp
ifeq "$(OSTYPE)" "msys"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) -rf gnu/bin gnu/doc gnu/etc gnu/share=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) -f gnu/m.ico gnu/msys.bat gnu/msys.ic= o
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)-rmdir gnu/tmp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)-rmdir gnu
endif
ifeq (true,$(INREPO))
ifneq (,$(INSTALLED_BK))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)EXTRALIST=3D`"$(INSTALLED_BK)" -A= ax | \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 grep -v '~$$\|c= onf-.*\.mk$$'` ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ "$$EXTRALIST" ]; then \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "Clean le= ft behind the following files:" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for file in $$EXTRA= LIST; do \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 echo "=C2=A0 $$file" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 done ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo Clean complete= ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
endif
endif

clobber: clean FORCE ## Same as 'clean' but also bk clean files
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -@$(BK) -A clean

# XXX subdirs? (see tags)
wc: $(HDRS) $(SRCS) $(SCRSRCS) $(MISC)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 wc -l $(SRCS) $(HDRS) $(SCRSRCS) $(MISC)

get-e: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -@$(BK) edit -qT `echo $(HDRS) $(SRCS) $(SCRSRC= S) $(MISC) | fmt -1|sort -u`
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(MAKE) tags

srcs: $(SRCS) $(HDRS) FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)for sub in $(SUBDIRS); do $(BK) -r$$sub co = -q; done

tags: $(patsubst %,%/tags.local, $(SUBDIRS)) tags.local
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @if [ -x $(BK) ]; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 then=C2=A0 =C2=A0 $(BK) get -Sq tags.skippats; = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(BK) _sort -u $^ |= grep -v -ftags.skippats > $@; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bk get -Sq tags.ski= ppats; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bk _sort -u $^ | gr= ep -v -ftags.skippats > $@; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo ctags completed

tags.local: $(SRCS) $(HDRS)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @ctags -f $@ --file-tags=3Dyes --c-types=3Dd+f+= s+t $^

%/tags.local: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(MAKE) -C $(dir $@) tags.local

ssh sshtest:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) realtest

rsh rshtest:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 PREFER_RSH=3DYES $(MAKE) realtest

test tests:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 DO_REMOTE=3DNO $(MAKE) -C t

nonet nonet_test localtest:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 BK_NONET=3DYES PREFER_RSH=3DYES $(MAKE) realtes= t

realtest: $(ALL) t/doit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -cd gui/tcltk && $(MAKE) clobber
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -$(BK) get -qS t/setup t/win32/win32_common
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(BK) -rt get -qTS 't.*'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd t && ./doit -f 5

guitest: $(ALL) t/doit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -$(BK) get -qS t/SCCS/s.g.* t/setup t/win32/win= 32_common t/guitest.tcl
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd t && ./doit -g -i

t/doit: t/doit.sh substvars
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./substvars t/doit.sh > t/doit
=C2=A0 =C2=A0 =C2=A0 =C2=A0 chmod +x t/doit

t/guitest: t/guitest.tcl
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cat < t/guitest.tcl > t/guitest

.PHONY: FORCE
FORCE:

win32: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd win32 && $(MAKE) BINDIR=3D$(BINDIR)<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 cd t/win32 && $(MAKE)

# build libraries in sub directories
%.a: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(MAKE) -C $(dir $@) $(notdir $@)

libc/mtst$(EXE): libc/libc.a FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(MAKE) -C libc mtst$(EXE)

bkres.o: win32/data/bk.rc bk.ico
=C2=A0 =C2=A0 =C2=A0 =C2=A0 windres -i win32/data/bk.rc -o bkres.o

bk.ico: win32/data/bk.ico
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cp -f win32/data/bk.ico .

ifneq ($(TOMCRYPT_SYSTEM),1)
# add dependency on building libraries first
$(BK): $(TOMCRYPT_LDFLAGS)
endif
ifneq ($(TOMMATH_SYSTEM),1)
# add dependency on building libraries first
$(BK): $(TOMMATH_LDFLAGS)
endif

$(BK): $(LIBS) bk.o $(RESOURCE) $(OBJ)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo LINKING $(BK),)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(LD) $(LDFLAGS) -o $@ bk.o $(OBJ) $(RESOUR= CE) $(LIBS) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(TOMCRYPT_LDFLAGS)= $(TOMMATH_LDFLAGS) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $(PCRE_LDFLAGS) $(L= Z4_LDFLAGS) $(ZLIB_LDFLAGS) $(XLIBS)

# Windows only rule, BKGUI should be blank on other platforms
$(BKGUI): bkg.o $(RESOURCE)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo LINKING $(BKGUI),)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(LD) $(LDFLAGS) -o $@ bkg.o $(RESOURCE) -L= libc -lc -mwindows $(XLIBS)

bk.script: bk.sh port/$(SYS)_platform.sh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cat port/$(SYS)_platform.sh bk.sh > bk.scrip= t
=C2=A0 =C2=A0 =C2=A0 =C2=A0 chmod +x bk.script

bkmsg.txt: bkmsg.doc
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cp -f $< $@

L-clean: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @rm -f gui/share/doc/L/little.man ../man/man1/b= k-little.1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @rm -f ../man/man2help/bk-little-1.fmt

# has to run before bkhelp.txt but after GUI
L-doc L-docs: GUI FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @test -f gui/share/doc/L/little.man || { \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo Failed to buil= d gui/share/doc/L/little.man; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @if [ -s gui/share/doc/L/little.man ]; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 then=C2=A0 =C2=A0 cp gui/share/doc/L/little.man= ../man/man1/bk-little.1; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else=C2=A0 =C2=A0 cp ../man/man1/bk-little.1.pf= mt ../man/man1/bk-little.1; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 chmod +w ../man/man1/bk-little.1

bkhelp.txt: $(BK) version L-docs FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @rm -f ../man/man2help/bk-little.fmt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cd ../man/man2help && $(MAKE) BK=3D$(H= ERE)/bk$(EXE) helptxt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cp ../man/man2help/helptxt bkhelp.txt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @rm -f ../man/man1/bk-little.1

html-docs: bkhelp.txt
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @cd ../man/man2html && $(MAKE)

../doc/bk_refcard.ps: $(BK) FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo building $@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)-$(BK) -r../doc co -qS
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(MAKE) -C ../doc BK=3D$(HERE)/bk$(EXE) all=

../doc/bk_refcard.pdf: ../doc/bk_refcard.ps

# This must be rebuilt every time because it includes the build time
bkver.c: utils/bk_version FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Building $@,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo "#include \"sccs.h\"&qu= ot; > bk.v
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo "char *bk_platform =3D \"&qu= ot;`./utils/bk_version`"\";" >> bk.v
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo "int test_release =3D "$(TRI= AL)";" >> bk.v
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo "time_t bk_build_timet =3D "= `perl -e "print time"`";" >> bk.v
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)echo "char *bk_build_dir =3D \"&q= uot;`pwd`"\";" >> bk.v
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)mv -f bk.v bkver.c

version: version.sh $(BK) utils/bk_version GUI FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 bash version.sh > $@

%: %.sh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Building $@,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(RM) $@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)cp $< $@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)chmod +x $@

%: %.l
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Not lexing $@,)

import: import.sh port/$(SYS)_platform.sh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cat port/$(SYS)_platform.sh import.sh > impo= rt.T
=C2=A0 =C2=A0 =C2=A0 =C2=A0 chmod +x import.T
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mv -f import.T import

# Quick and dirty target so we can make all the gui tools without the rest<= br> .PHONY: GUI
GUI: PCRE $(BK)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @$(MAKE) -Cgui BK=3D$(HERE)/bk$(EXE) gui

install: installdir
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tmp/bitkeeper/bk _install -d -f $(DESTDIR)$(BIN= DIR)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo BitKeeper is installed in $(BINDIR)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo We suggest you run:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo sudo $(BINDIR)/bk links /usr/local/bin =C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo to create the bk symlink.

installdir: utils/registry.tcl
=C2=A0 =C2=A0 =C2=A0 =C2=A0 rm -rf $(IMGDIR) || exit 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mkdir -p $(IMGDIR)/contrib
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mkdir -p $(IMGDIR)/lscripts
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -$(BK) -rwww get -S
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -cp -f -r www $(IMGDIR)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 -$(BK) get -S $(CONTRIB)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 tar cf - $(BINS) $(SCRIPTS) lscripts gui/bin gu= i/lib gui/images \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | (cd $(IMGDIR) &am= p;& tar xf -)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cp -f $(DATA) $(IMGDIR)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cp -f $(CONTRIB) $(IMGDIR)/contrib
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (cd ../doc/nested && $(MAKE) install HT= ML=3D$(IMGDIR)/html)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if [ $(SYS) =3D unix ]; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 then=C2=A0 =C2=A0 $(BK) get -S ../man/Makefile;= \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cd ../man &&= ; $(MAKE) install BINDIR=3D$(IMGDIR) ;\
=C2=A0 =C2=A0 =C2=A0 =C2=A0 else \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cd win32 &&= ; $(MAKE) BINDIR=3D$(IMGDIR) install); \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 cp utils/registry.t= cl $(IMGDIR)/gui/lib; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd $(IMGDIR); \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 find . -type l | \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 perl -ne 'chomp= ; $$a =3D readlink; print "$$a|$$_\n";'>symlinks; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 test -s symlinks || rm -f symlink= s
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @true

image:=C2=A0 ## Build the installer (left in src/utils/bk-*)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) p
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) _image

_image:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) installdir
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${MAKE} -Cutils BINDIR=3D$(IMGDIR) "CC=3D$= (CC)" "BK=3D$(HERE)/bk$(EXE)" "CFLAGS=3D$(CFLAGS)"= image

crankturn: crank.sh remote.sh=C2=A0 ## Run a clean-build + regressions in c= luster
=C2=A0 =C2=A0 =C2=A0 =C2=A0 REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh = LOG=3D$(LOG) bash crank.sh

cranksave: crank.sh remote.sh=C2=A0 ## Run a crankturn but save the built i= mages
=C2=A0 =C2=A0 =C2=A0 =C2=A0 REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh = LOG=3D$(LOG) bash crank.sh save

crankstatus: crank.sh remote.sh=C2=A0 ## See how the crank is going
=C2=A0 =C2=A0 =C2=A0 =C2=A0 REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh = LOG=3D$(LOG) bash crank.sh status

crankrelease nightly: $(BK) crank.sh remote.sh=C2=A0 ## Do a BitKeeper rele= ase (or nightly build)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @(TAG=3D$(shell $(BK) changes -r+ -d:TAG:) ; \<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 test x$$TAG =3D x && { \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo Cannot crankre= lease with a non-tagged tip ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1 ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 } ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 case $@ in \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 crankrelease ) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TYPE=3Drelease; DIR= =3D/home/bk/images/$$TAG; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 nightly ) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TYPE=3Dnightly; DIR= =3D/home/bk/images/nightly; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HOSTS=3D"$(NIG= HTLY_HOSTS)" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 esac ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 test -d $$DIR || mkdir -p $$DIR ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 REPO=3D$(REPO) URL=3D$(URL) HOSTS=3D$$HOSTS REM= OTE=3Dremote.sh \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LOG=3D$(LOG) bash crank.sh $$TYPE= ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(BK) -R get -qS ../RELEASE-NOTES.md ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cp ../RELEASE-NOTES.md $$DIR ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 SAVED_WD=3D$(shell pwd) ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 cd $$DIR && chmod +rx bk-* >/dev/nul= l 2>&1 ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 rm -f MD5SUMS ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 md5sum bk-* >> MD5SUMS ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "Your images are in $$DIR" ; \ =C2=A0 =C2=A0 =C2=A0 =C2=A0 case $@=C2=A0 in=C2=A0 \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 crankrelease ) \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "Run '= ;./mkrelease $$TAG' to release this version of bk."; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 nightly ) \
#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd $$SAVED_WD ; \ #=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0./mkupgrades --nigh= tly $$TAG ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 esac)

crankclean: crank.sh remote.sh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 REPO=3D$(REPO) URL=3D$(URL) REMOTE=3Dremote.sh = LOG=3D$(LOG) bash crank.sh clean

# This target assumes a bk repository
.PHONY: src-tar
src-tar: $(BK) version ## build tar.gz image for the current tree
ifeq (false,$(INREPO))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(error This target only works in a BK source r= epository)
else
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./bk here add default TCLTK
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)-mkdir -p tmp/src
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)(DIR=3Dbk-$(shell $(BK) version -s) ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TAR=3D"$$DIR".tar= .gz ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "Creating $$TAR i= n tmp/src..." ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cd tmp/src ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rm -rf "$$DIR" ; = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0../../bk export -tplain -kw= r+ -sdefault -sTCLTK "$$DIR" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cat ../../version > &quo= t;$$DIR/src/bkvers.txt" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0tar -czf "$$TAR" = "$$DIR" ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rm -rf "$$DIR" ; = \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo Done ; \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 )
endif

# only depend on conf.mk.local if it exists
= conf.mk: mkconf.sh $(wildcard conf.mk.local)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 sh mkconf.sh > $@ || { $(RM) $@; false; }
%.o: %.c
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo CC $<,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@<= br>
port/startmenu.o: port/startmenu.c $(HDRS)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo CC $<,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)$(CC) $(CFLAGS) -fno-strict-aliasing $(CPPF= LAGS) -c $< -o $@

depend: $(SRCS)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(CC) -MM -MG -D_DEPEND $(SRCS) > depends
# for system.h we need to actually run libc's makefile because it inclu= des
# calculated header files
libc/system.h: FORCE
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) -C libc system.h

libc/libc.a: libc/system.h

sccs.h: PCRE
.PHONY: PCRE
PCRE:
ifneq ($(PCRE_SYSTEM),1)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(MAKE) -Cgui/tcltk pcre
endif

$(OBJ) bk.o: $(HDRS)

cmd.c cmd.h: cmd.pl bk.sh $(filter bkd_%,$(SRCS))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Building $@,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)perl cmd.pl || (rm -f cmd.c cmd.h; exit = 1)

# This parses slib.c and extracts the meta-data keywords expanded
# by kw2val() and passes them to gperf to generate hash lookup code.
slib.o: kw2val_lookup.c
kw2val_lookup.c: slib.c kw2val.pl
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(if $(Q),@echo Building $@,)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(Q)perl kw2val.pl slib.c || (rm -f kw2va= l_lookup.c; exit 1)

check-syntax:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(CC) $(CFLAGS) $(CPPFLAGS) -c -S ${CHK_SOURCES= } -o /dev/null

# print a make variable=C2=A0 'make print-REPO'
#=C2=A0 =C2=A0http://= www.cmcrossroads.com/article/printing-value-makefile-variable
print-%:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo $* =3D \"$($*)\"

.PHONY: help

help:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @grep -E -h '^[-a-zA-Z_\ ]+:.*?## .*$$'= $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS =3D ":.*?## "}; {pr= intf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @echo Suggested: make -j12 image

--0000000000003c4553061b3f3c67--