X-Git-Url: https://git.stg.codes/ssmd.git/blobdiff_plain/6c4b6a06234acd26e1d9bbb51668157263165fe1..c3078dfc9f61658f14c3854ad0c39d0df07fe80b:/Makefile diff --git a/Makefile b/Makefile index ad0f662..5b86f16 100644 --- 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 $@