Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Oct 2018 17:52:33 -0400
From:      William Parsons <>
Subject:   old Makefile for building library no longer works
Message-ID:  <86bm7n9dcu.fsf@anukis.local.i-did-not-set--mail-host-address--so-tickle-me>

Next in thread | Raw E-Mail | Index | Archive | Help
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


all: $(LIBTEST)

LIBSRC  = test.c

# Do not automatically delete library source files

LIBOBJ	= $(LIBSRC:%.c=%.o)

	$(AR) $(ARFLAGS) $@ $?
	rm -f $?

	@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 <stdio.h>

test(char const *text)
    printf("%s\n", text);
    return 1;
--8<---------------cut here---------------end--------------->8---

It looks like the Makefile directive dependency:


no longer works and claims the target is up to date when it doesn't even

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


Want to link to this message? Use this URL: <>