From owner-freebsd-bugs Tue Apr 13 11:12:36 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 36D30157C4 for ; Tue, 13 Apr 1999 11:12:20 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id LAA16637; Tue, 13 Apr 1999 11:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from obsidian.noc.dfn.de (obsidian.noc.dfn.de [193.174.247.193]) by hub.freebsd.org (Postfix) with ESMTP id 5447D157A3 for ; Tue, 13 Apr 1999 11:05:43 -0700 (PDT) (envelope-from schweikh@obsidian.noc.dfn.de) Received: (from schweikh@localhost) by obsidian.noc.dfn.de (8.8.7/8.8.7) id UAA20827 for FreeBSD-gnats-submit@freebsd.org; Tue, 13 Apr 1999 20:03:19 +0200 (MET DST) Message-Id: <199904131803.UAA20827@obsidian.noc.dfn.de> Date: Tue, 13 Apr 1999 20:03:19 +0200 (MET DST) From: Jens Schweikhardt To: FreeBSD-gnats-submit@freebsd.org Subject: bin/11114: make(1) does not work as documented with .POSIX: target Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 11114 >Category: bin >Synopsis: make(1) does not work as documented with .POSIX: target >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 13 11:10:00 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Jens Schweikhardt >Release: FreeBSD 3.1-STABLE i386 >Organization: DFN Network Operation Center >Environment: FreeBSD hal9000 3.1-STABLE FreeBSD 3.1-STABLE #0: Sat Apr 3 15:24:10 CEST 1999 toor@hal9000.details.de:/usr/src/sys/compile/HAL9000 i386 unmodified /etc/make.conf no /etc/make.conf.local >Description: Condider the following Makefile (where prog.c is hello-world): .POSIX: prog: prog.o echo $(%POSIX) $(CC) -o prog prog.o clean: rm -f prog prog.o When I run 'make' this is what is done: $ make cc -O -pipe -c prog.c echo 1003.2 1003.2 cc -o prog prog.o However, /usr/share/mk/sys.mk says: # from: @(#)sys.mk 8.2 (Berkeley) 3/21/94 # $Id: sys.mk,v 1.43 1998/09/15 05:24:01 obrien Exp $ unix ?= We run FreeBSD, not UNIX. # If the special target .POSIX appears (without prerequisites or # commands) before the first noncomment line in the makefile, make shall # process the makefile as specified by the Posix 1003.2 specification. # make(1) sets the special macro %POSIX in this case (to the actual # value "1003.2", for what it's worth). # # The rules below use this macro to distinguish between Posix-compliant # and default behaviour. ... .if defined(%POSIX) CC ?= c89 .else CC ?= cc .endif CFLAGS ?= -O -pipe ... Thus, I expect CC to be c89 (I can't see where CC is set from actually). What's more, as soon as c89 is used, CFLAGS must not contain non-POSIX compiler options like -pipe, because otherwise c89 rightfully barfs: $ make CC=c89 c89 -O -pipe -c prog.c Illegal option -p usage: c89 [-c] [-D name[=value]] [...] [-E] [-g] [-I directory ...] [-L directory ...] [-o outfile] [-O] [-s] [-U name ...] operand ... *** Error code 64 Stop. I tried 'make -d A' for debugging, but CC=cc seems to be set in some global place: $ make -d A Global:.MAKEFLAGS = -d Global:.MAKEFLAGS = -d A Global:.TARGETS = Caching /usr/share/mk...done expanding "sys.mk".../usr/share/mk/sys.mk Global:MAKEFILE = /usr/share/mk/sys.mk Global:unix = We run FreeBSD, not UNIX. Global:X11BASE = /usr/X11R6 Global:AR = ar Global:ARFLAGS = rl Global:RANLIB = ranlib Global:AS = as Global:AFLAGS = Global:CC = cc <----- why is this not c89? ...etc It seems the .if defined(%POSIX) doesn't work properly. Or I have overlooked something. Or something funny is going on. Regards, Jens -- Jens Schweikhardt http://www.shuttle.de/schweikh/ SIGSIG -- signature too long (core dumped) >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: To: FreeBSD-gnats-submit@freebsd.org Subject: make(1) does not work as documented with .POSIX: target From: schweikh@noc.dfn.de Reply-To: schweikh@noc.dfn.de X-send-pr-version: 3.2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message