From owner-freebsd-questions@freebsd.org Sun Oct 21 21:52:37 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B927103798D for ; Sun, 21 Oct 2018 21:52:37 +0000 (UTC) (envelope-from gyliamos@gmail.com) Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9D47A51E for ; Sun, 21 Oct 2018 21:52:36 +0000 (UTC) (envelope-from gyliamos@gmail.com) Received: by mail-qt1-x833.google.com with SMTP id j46-v6so44178317qtc.9 for ; Sun, 21 Oct 2018 14:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:reply-to:date:message-id:mime-version; bh=EJKxx+bfgYXULrJtcPKmqeMj4qHySuOrks1AjDHM0v0=; b=u3IkxHMui1IK0hUwRVg+M+ZnjdI53pCHTM10gR5OKNe/pK+xCICtMZSVFSFif0Dcua 5nkua8Ys3jX45KzyBRtCKYU6A9QtOp9vAiJCbrk9d9N3nvYTLkUNaJO1gvPVlbuKFm6a 8AyOvL//t9sCjRnFfrBi8++49ciAuxxHW84a2pOdDOlIRc2VsNImtwBSCIM/Buv1/I26 BWVhjrxBjpZ0m+PlBtVsrvPDb/xdldh5XpV/mF464KIX/FQEs/AqYxh8YajCMxoW+8fj kHoM8496BLry3ADcDzsXchKpoqX4BJxpS0nB/CdomNquznqIwD5e9G3QIyrkzL0UYuwm j3fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:reply-to:date:message-id :mime-version; bh=EJKxx+bfgYXULrJtcPKmqeMj4qHySuOrks1AjDHM0v0=; b=GVcF1R7I0ia9ZcqtJ0BDtEpyeeHpDIw6+9Ta9ug7WHE5+1T1ZJL8KU9bvOQpbaeHxA 6ZoImr85cXKmKsWm2k/wzQ9SkOSJghkO1vBb+I0Qo3l1H5u8IRqiSf63Vc8ZEpAMwT1g f1bVsOTDiRc8CkoWJNMwtEinXAXk9SjqQn47HfjARBAOp7hQBMxJD4/ynrilN3pd2wxe 6AHNt1LDw3Kd605KGu2tH+566OrEfPBuCVlAXiAf5pTYWtnmKUYOFP4J1eENDAZKu2Z9 biTfpT63ABvAbKASGCbGGyy2VTI0EknvZr4LaKe6x7lgsc+/+NspFYDAVWU7Rw6PgdLa V6cw== X-Gm-Message-State: ABuFfogvKsVNYW5Jv5EQzWOFPHb9VQU5k+LZ7ojNO58QKnlYQxpHkXFa iB6+b+W7T+nn5ig5L0ofMmk= X-Google-Smtp-Source: ACcGV632oMcac2FQ4SO9gicsdsC63LF+uzj+Ejz37ftzXr7egqkV/zceJWALDbMpdPAgYuYxOAsGYw== X-Received: by 2002:a0c:f90a:: with SMTP id v10mr43652649qvn.24.1540158756376; Sun, 21 Oct 2018 14:52:36 -0700 (PDT) Received: from anukis.local ([2601:182:380:26f0:1dd5:c7d4:71f1:5e84]) by smtp.gmail.com with ESMTPSA id f38-v6sm8677103qtf.63.2018.10.21.14.52.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 Oct 2018 14:52:35 -0700 (PDT) From: William Parsons X-Google-Original-From: William Parsons To: freebsd-questions@freebsd.org Subject: old Makefile for building library no longer works Reply-to: "William Parsons" Date: Sun, 21 Oct 2018 17:52:33 -0400 Message-ID: <86bm7n9dcu.fsf@anukis.local.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2018 21:52:37 -0000 I haven't been doing a lot of C programming lately, but recently I revisited an old project and found the old Makefile to build a library under FreeBSD no longer works. (I've verified that this still worked as of FreeBSD 9.3 and will still work if gmake is used.) Here's a much simplified version of the Makefile that used to work: --8<---------------cut here---------------start------------->8--- LIBTEST = libTest.a .PRECIOUS: $(LIBTEST) all: $(LIBTEST) LIBSRC = test.c # Do not automatically delete library source files .SECONDARY: $(LIBSRC) LIBOBJ = $(LIBSRC:%.c=%.o) $(LIBTEST): $(LIBTEST)($(LIBOBJ)) $(AR) $(ARFLAGS) $@ $? rm -f $? clean: @rm -f *.o $(LIBTEST) --8<---------------cut here---------------end--------------->8--- And here's a trivial C source file to go with it: --8<---------------cut here---------------start------------->8--- /* test.c */ #include int test(char const *text) { printf("%s\n", text); return 1; } --8<---------------cut here---------------end--------------->8--- It looks like the Makefile directive dependency: $(LIBTEST): $(LIBTEST)($(LIBOBJ)) no longer works and claims the target is up to date when it doesn't even exist. I've been perusing 'man make' without success. One thing that puzzles me is that 'man make' says "For a more thorough description of make and makefiles, please refer to PMake - A Tutorial." Is this accurate? I was under the impression that pmake was replaced by bsdmake in recent versions of FreeBSD - is this the source of my problems? -- Will