From owner-freebsd-questions@freebsd.org Wed Jan 31 17:39:56 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 E9589ED8927 for ; Wed, 31 Jan 2018 17:39:55 +0000 (UTC) (envelope-from koue@chaosophia.net) Received: from chaosophia.net (chaosophia.net [91.121.173.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7965F6FF7C for ; Wed, 31 Jan 2018 17:39:55 +0000 (UTC) (envelope-from koue@chaosophia.net) Received: from chaosophia.net (localhost [127.0.0.1]) by chaosophia.net (8.15.2/8.15.2) with ESMTP id w0VHdfDG074411 for ; Wed, 31 Jan 2018 18:39:41 +0100 (CET) (envelope-from koue@chaosophia.net) Received: (from _prayer@localhost) by chaosophia.net (8.15.2/8.15.2/Submit) id w0VHdf5Q074410 for freebsd-questions@freebsd.org; Wed, 31 Jan 2018 18:39:41 +0100 (CET) (envelope-from koue@chaosophia.net) Received: from [194.97.158.70] by chaosophia.net with HTTP (Prayer-1.3.5); 31 Jan 2018 18:39:40 +0100 Date: 31 Jan 2018 18:39:40 +0100 From: Nikola Kolev To: freebsd-questions@freebsd.org Subject: bsd.lib.mk LIBDIR Message-ID: X-Mailer: Prayer v1.3.5 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, SURBL_BLOCKED,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chaosophia.net X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2018 17:39:56 -0000 Howdy, I'm dealing with bsd.lib.mk and if 'LIBDIR' is defined in the Makefile file it's not handled properly. # cat Makefile LIB= test CFLAGS+= -Wall -Wstrict-prototypes SRCS= test.c NO_OBJ= yes .include # make cc -O2 -pipe -Wall -Wstrict-prototypes -DNDEBUG -std=gnu99 -Qunused-arguments -c test.c -o test.o building static test library ranlib -D libtest.a # make install install -C -o root -g wheel -m 444 libtest.a /usr/lib # ls -la /usr/lib/libtest.a -r--r--r-- 1 root wheel 1398 Jan 31 18:23 /usr/lib/libtest.a If 'LIBDIR' is defined the library file is installed as '${LIBDIR}' not in '${LIBDIR}' # cat Makefile LIB= test CFLAGS+= -Wall -Wstrict-prototypes SRCS= test.c NO_OBJ= yes LIBDIR= /usr/lib/mylibz .include # make cc -O2 -pipe -Wall -Wstrict-prototypes -DNDEBUG -std=gnu99 -Qunused-arguments -c test.c -o test.o building static test library ranlib -D libtest.a # make install install -C -o root -g wheel -m 444 libtest.a /usr/lib/mylibz # ls -la /usr/lib/mylibz -r--r--r-- 1 root wheel 1398 Jan 31 18:24 /usr/lib/mylibz According to /usr/share/mk/bsd.README: LIBDIR Target directory for libraries. Instead of install the library file as '${LIBDIR}' 'make' should complain if the directory is missing or try to create it and then install the library file in it. Did I miss something? Thanks, Nikola -- Nikola Kolev koue@chaosophia.net https://github.com/koue/