From owner-freebsd-questions@FreeBSD.ORG Wed Dec 30 07:17:58 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C53DA1065696 for ; Wed, 30 Dec 2009 07:17:58 +0000 (UTC) (envelope-from olivermahmoudi@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 5DFE58FC16 for ; Wed, 30 Dec 2009 07:17:58 +0000 (UTC) Received: by fxm27 with SMTP id 27so11304236fxm.3 for ; Tue, 29 Dec 2009 23:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=CFGNEd3qfOjE8r5qpdQcli+V9m0orbh/CgewCStMuSE=; b=irtqwigIn5cmyAnc5FhTNILJYCZFC/rEtiNuSaz0zlT3UedjqlFRJzAvPm0SRTkxs9 PqkK2u2qUGjJVdGJ6uuctLeP9vgK+uTaxh0Fof1fdZDemO1rU8Y0TrnQdP+O3cuy6MX4 ZelUVJoop0+EIvGMauTg/FWA4urDEjmdzgrSs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=thgltQ3mjHtqoXtJl+RXRT8Io08nGN7l7mA8g5tPygrZkvifAEiDtyCw13H8CD/BsT IwBLrg35kfoC4rkg+YUnVH9R+ffRw8leTaOFj/7tsyWM90+Fhyd1kMwjTVycZw/8nj3c lLr26Thls7oQ9phODXTnMUsPZ86wYX6VxGCDU= MIME-Version: 1.0 Received: by 10.239.167.66 with SMTP id f2mr77080hbe.143.1262157472517; Tue, 29 Dec 2009 23:17:52 -0800 (PST) Date: Wed, 30 Dec 2009 08:17:52 +0100 Message-ID: <6b4b2d2c0912292317h7c4d9bbfo196dcf48396e0afa@mail.gmail.com> From: Oliver Mahmoudi To: "freebsd-questions@FreeBSD.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: how does the C pre-processor interface with make? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2009 07:17:58 -0000 Hey folks, I was wondering how the C pre-processor interfaces with make. Let's suppose that I have a little C program, something along the lines of: #include int main() { #ifdef FOO fprintf(stdout, "Hi, my name is foo.\n"); #endif #ifdef BAR fprintf(stdout, "Hi, my name is bar.\n"); #endif fprintf(stdout, "I am always here.\n"); return(1-1); } It is easy to control the pre-processor in the above code by defining the respective terms or leaving them out, however, I am trying to control the conditionals from out of a makefile. This is essentially the way in which the kernel sources are compiled. Any suggestions? Thanks Oliver