MAC_BOOST_PATH = -L/opt/local/lib
LINUX_BOOST_PATH = -L/usr/lib/
DEFAULT_PATH = -L/usr/local/lib
BOOST_PATH = $(DEFAULT_PATH)
ifeq ($(UNAME), Darwin)
BOOST_PATH = MAC_BOOST_PATH
@echo Compiling for Mac OS X
@echo
endif
ifeq ($(UNAME), Linux)
BOOST_PATH = LINUX_BOOST_PATH
@echo Compiling for Linux
@echo
endif
The echo's aren't printing, and the BOOST_PATH isn't changing, I don't think... So... I'm not sure what I'm doing wrong here... =\
You can't put commands in a Makefile independent of targets. You need to introduce a target which displays the OS. Also, you're lacking '$()'. Use e.g.
UNAME=$(shell uname)
MAC_BOOST_PATH = -L/opt/local/lib
LINUX_BOOST_PATH = -L/usr/lib/
DEFAULT_PATH = -L/usr/local/lib
BOOST_PATH = $(DEFAULT_PATH)
ifeq ($(UNAME),Darwin)
BOOST_PATH=$(MAC_BOOST_PATH)
endif
ifeq ($(UNAME),Linux)
BOOST_PATH=$(LINUX_BOOST_PATH)
endif
all: showos
showos:
@echo compiling for $(UNAME)
You’re not defining the UNAME variable anywhere. You probably want something like this:
UNAME = $(shell uname)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With