Hi Guys,
I've got (and attached) this simple Makefile that checks the build platform
of a machine.
Here's the cut-and-pasted content of the Makefile:
PLATFORM=$(shell uname -s | cut -f 1 -d | cut -f 1 -d _);
dummy:
ifeq (${PLATFORM}, CYGWIN)
echo cygwin;
else
echo linux;
endif
When run under Linux:
[EMAIL PROTECTED] /tmp
$ make --version
GNU Make 3.80
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
[EMAIL PROTECTED] /tmp
$ md5sum Makefile
18395e930e3a5e56c0ce9dc82f184c15 Makefile
[EMAIL PROTECTED] /tmp
$ make
echo linux;
linux
When run under Cygwin:
[EMAIL PROTECTED] /tmp
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i686-pc-cygwin
[EMAIL PROTECTED] /tmp
$ md5sum Makefile
18395e930e3a5e56c0ce9dc82f184c15 *Makefile
[EMAIL PROTECTED] /tmp
$ make
echo linux;
linux
As you could see from the md5s, I run the same Makefile. Under the Linux
machine, I run an older make version, 3.80. On Cygwin, I use make version
3.81.
The output under cygwin should've been:
echo cygwin
cygwin
And yes, I know the workarounds, using inline shell command within the
Makefile, and yes, the workarounds worked properly. However, I'd like to
see the make conditionals work correctly.
For completeness' sake and FWIW, I've also attached cygcheck's output.
Any hints?
Thank you very much.
Best Regards,
Carlo
--
Carlo Florendo
Softare Engineer/Network Co-Administrator
Astra Philippines Inc.
UP-Ayala Technopark, Diliman 1101, Quezon City
Philippines
http://www.astra.ph
--
The Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp
PLATFORM=$(shell uname -s | cut -f 1 -d | cut -f 1 -d _);
dummy:
ifeq (${PLATFORM}, CYGWIN)
echo cygwin;
else
echo linux;
endif
Cygwin Configuration Diagnostics
Current System Time: Thu Jul 19 11:59:42 2007
Windows 2000 Professional Ver 5.0 Build 2195 Service Pack 4
Path: e:\cygwin\usr\local\bin
e:\cygwin\bin
e:\cygwin\bin
e:\cygwin\usr\X11R6\bin
c:\WINNT\system32
c:\WINNT
c:\WINNT\System32\Wbem
f:\cygwin\bin
d:\MySQL\MySQL Server 4.1\bin
d:\Common Files\GTK\2.0\bin
d:\Microsoft Visual Studio\Common\Tools\WinNT
d:\Microsoft Visual Studio\Common\MSDev98\Bin
d:\Microsoft Visual Studio\Common\Tools
d:\Microsoft Visual Studio\VC98\bin
e:\cygwin\usr\local\bin
e:\cygwin\usr\local\sbin
Output from e:\cygwin\bin\id.exe (nontsec)
UID: 1000(admin)GID: 513(None)
0(root) 513(None) 544(Administrators) 545(Users)
Output from e:\cygwin\bin\id.exe (ntsec)
UID: 1000(admin)GID: 513(None)
0(root) 513(None) 544(Administrators) 545(Users)
SysDir: C:\WINNT\system32
WinDir: C:\WINNT
USER = 'admin'
PWD = '/tmp'
CYGWIN = 'server'
HOME = '/home/admin'
MAKE_MODE = 'unix'
HOMEPATH = '\Documents and Settings\admin'
APPDATA = 'C:\Documents and Settings\admin\Application Data'
MANPATH = '/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man'
HOSTNAME = 'desktop1'
PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 1 Stepping 2, GenuineIntel'
TERM = 'xterm'
WINDIR = 'C:\WINNT'
WINDOWID = '7879448'
OLDPWD = '/cygdrive/e/midicff2'
USERDOMAIN = 'THORIN'
ALLUSERSPROFILE = 'C:\Documents and Settings\All Users'
OS = 'Windows_NT'
OS2LIBPATH = 'C:\WINNT\system32\os2\dll;'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
TEMP = '/cygdrive/c/DOCUME~1/admin/LOCALS~1/Temp'
LIB = 'D:\Microsoft Visual Studio\VC98\mfc\lib;D:\Microsoft Visual
Studio\VC98\lib'
USERNAME = 'admin'
PROCESSOR_LEVEL = '15'
SYSTEMDRIVE = 'C:'
USERPROFILE = 'C:\Documents and Settings\admin'
LOGONSERVER = '\\THORIN'
PS1 = '\[\e]0;[EMAIL PROTECTED] \[\e[33m\]\w\[\e[0m\]\n\$ '
PROCESSOR_ARCHITECTURE = 'x86'
COLORFGBG = '15;default;0'
SHLVL = '2'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
HOMEDRIVE = 'C:'
COMSPEC = 'C:\WINNT\system32\cmd.exe'
SYSTEMROOT = 'C:\WINNT'
TMP = '/cygdrive/c/DOCUME~1/admin/LOCALS~1/Temp'
PROCESSOR_REVISION = '0102'
CVS_RSH = '/bin/ssh'
PRINTER = '\\printsrv1\hp LaserJet 1000'
MSDEVDIR = 'D:\Microsoft Visual Studio\Common\MSDev98'
PKG_CONFIG_PATH = '/usr/X11R6/lib/pkgconfig'
PROGRAMFILES = 'C:\Program Files'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'
DISPLAY = ':0'
NUMBER_OF_PROCESSORS = '1'
INCLUDE = 'D:\Microsoft Visual Studio\VC98\atl\include;D:\Microsoft Visual
Studio\VC98\mfc\include;D:\Microsoft Visual Studio\VC98\include'
COMPUTERNAME = 'THORIN'
COLORTERM = 'rxvt-xpm'
_ = '/usr/bin/cygcheck'
POSIXLY_CORRECT = '1'
HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus