Note that Makefiles are extremely sensitive to spacing. Here's an example of a Makefile that runs an extra command on OS X and which works on OS X and Linux. Overall, though, autoconf/automake is the way to go for anything at all non-trivial.
UNAME := $(shell uname -s)CPP = g++CPPFLAGS = -pthread -ansi -Wall -Werror -pedantic -O0 -g3 -I /nexopia/includeLDFLAGS = -pthread -L/nexopia/lib -lboost_systemHEADERS = data_structures.h http_client.h load.h lock.h search.h server.h thread.h utility.hOBJECTS = http_client.o load.o lock.o search.o server.o thread.o utility.o vor.oall: vorclean: rm -f $(OBJECTS) vorvor: $(OBJECTS) $(CPP) $(LDFLAGS) -o vor $(OBJECTS)ifeq ($(UNAME),Darwin) # Set the Boost library location install_name_tool -change libboost_system.dylib /nexopia/lib/libboost_system.dylib vorendif%.o: %.cpp $(HEADERS) Makefile $(CPP) $(CPPFLAGS) -c $