T
tmponko
OK...I'm new to this and I'm sure I'm missing something obvious, so
please be kind.
I've tried several different approaches to this problem (including
various if, ifeq, and case constructs), and I'm about to give up. Can
any tell me why this doesn't work? In a nutshell, I want a Makefile
that will "include" either a Linux.mk or a SunOS.mk without having to
rely on an explicit command line parameter or env var.
Here is the segment that is giving me trouble:
#########################################################################
#
#
# Sample Makefile #
#
#
#########################################################################
#.SILENT:
# Use a known shell
SHELL=/bin/sh
# Obtain OS name (e.g., "Linux" or "SunOS")
THE_OS := `uname`
# Name the INCFILE using the OS name (e.g., "Macros.Linux.mk")
INCFILE := $(HOME)/src/Macros.$(THE_OS).mk
# Test defined macros to see if I have what I expect
echo:
@echo "THE_OS = :"$(THE_OS)":"
@echo "INCFILE = :"$(INCFILE)":"
ls -al $(INCFILE)
# Include the project default macros
include $(INCFILE)
<EOF>
-----------------------And here is the error I get
---------------------------
localhost.localdomain]/home/tponko/src% make
Makefile:20: /home/tponko/src/Macros.`uname`.mk: No such file or
directory
make: *** No rule to make target `/home/tponko/src/Macros.`uname`.mk'.
Stop.
Any/all help will be greatly appreciated.
Thanks...
please be kind.
I've tried several different approaches to this problem (including
various if, ifeq, and case constructs), and I'm about to give up. Can
any tell me why this doesn't work? In a nutshell, I want a Makefile
that will "include" either a Linux.mk or a SunOS.mk without having to
rely on an explicit command line parameter or env var.
Here is the segment that is giving me trouble:
#########################################################################
#
#
# Sample Makefile #
#
#
#########################################################################
#.SILENT:
# Use a known shell
SHELL=/bin/sh
# Obtain OS name (e.g., "Linux" or "SunOS")
THE_OS := `uname`
# Name the INCFILE using the OS name (e.g., "Macros.Linux.mk")
INCFILE := $(HOME)/src/Macros.$(THE_OS).mk
# Test defined macros to see if I have what I expect
echo:
@echo "THE_OS = :"$(THE_OS)":"
@echo "INCFILE = :"$(INCFILE)":"
ls -al $(INCFILE)
# Include the project default macros
include $(INCFILE)
<EOF>
-----------------------And here is the error I get
---------------------------
localhost.localdomain]/home/tponko/src% make
Makefile:20: /home/tponko/src/Macros.`uname`.mk: No such file or
directory
make: *** No rule to make target `/home/tponko/src/Macros.`uname`.mk'.
Stop.
Any/all help will be greatly appreciated.
Thanks...