Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: net.unix Subject: Re: Using sh in makefiles Message-ID: <1796@brl-smoke.ARPA> Date: Sun, 29-Jun-86 01:22:03 EDT Article-I.D.: brl-smok.1796 Posted: Sun Jun 29 01:22:03 1986 Date-Received: Mon, 30-Jun-86 05:35:17 EDT References: <1991@dalcs.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: net Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 34 In article <1991@dalcs.UUCP> silvert@dalcs.UUCP (Bill Silvert) writes: -Would like advice on how to use shell commands (such as if...) in -makefiles. I know that it all has to be on one line, but the only way I -can make a command work is through a kludge like: - -test: - echo "if x;then y;fi" | sh - -which seems pretty roundabout. Is this the only way to do it? I really don't understand why you've had any problems: test: if x; then y; fi OR test: if x ; \ then y ; \ fi Perhaps you're using one of those antique versions of UNIX that has a "make" and shell that conspire to report that the "if" command has failed; if so, just use a dash prefix on the command: test: -if x; \ then y; \ fi I would like to once again plea that people posting problems tell us what version of UNIX they're running, since there are several and they don't all behave the same way.