]> git.stg.codes - ssmd.git/blobdiff - Makefile
Fix build on osx.
[ssmd.git] / Makefile
index ad0f66296af2ad48e6895f2f25dbd46c2315d42e..5b86f16734c5fcc9eea5cb7633dece6997572706 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,18 @@ ifeq ($(BUILD),Debug)
        CXXFLAGS += -g3
 endif
 
-INCS = -Iinclude -I3rdparty/snmp++/include
+UNAME = $(shell uname -s)
+
+ifeq ($(UNAME), Darwin)
+       BOOST_SUFFIX = -mt
+endif
+
+INCS = -I/opt/local/include -Iinclude -I3rdparty/snmp++/include
 CXXFLAGS += -W -Wall -Wextra $(INCS) $(DEFS)
-LIBS = 3rdparty/snmp++/libsnmp++.a \
-       -lboost_system \
-       -lboost_program_options \
+LIBS = -L/opt/local/lib \
+       3rdparty/snmp++/libsnmp++.a \
+       -lboost_system$(BOOST_SUFFIX) \
+       -lboost_program_options$(BOOST_SUFFIX) \
        -lcurl \
        -lssl \
        -lcrypto \
@@ -45,8 +52,9 @@ snmplib:
 include/version.h: version
 
 version:
-       @sed 's/@VERSION@/$(VERSION)/g' include/version.h.in > include/version.h
-       @sed -i 's/@GIT_SHA@/'`git rev-parse --short HEAD`'/g' include/version.h
+       @sed 's/@VERSION@/$(VERSION)/g' include/version.h.in > include/version.h.tmp
+       @sed "s/@GIT_SHA@/$$(git rev-parse --short HEAD)/g" include/version.h.tmp > include/version.h
+       @rm include/version.h.tmp
 
 $(PROG): version $(subst .cpp,.o,$(SOURCES)) snmplib
        $(CXX) $(subst .cpp,.o,$(SOURCES)) $(LIBS) -o $@