1 # Your system. Expands to 'GNU/Linux' or 'Cygwin'
2 SYSTEM = $(shell uname)
14 # Root of Lua Installation
15 INSTALL_ROOT=/usr/local
16 INSTALL_SHARE=$(INSTALL_ROOT)/share/lua/$(LV)
17 INSTALL_LIB=$(INSTALL_ROOT)/lib/lua/$(LV)
18 INSTALL_DOC=$(INSTALL_ROOT)/share/doc/$(MODULE)
22 INSTALL_EXEC = $(INSTALL) -m 0755
23 INSTALL_DATA = $(INSTALL) -m 0644
24 INSTALL_COPY = cp -p -r
28 ROCKSPEC=luasnmp-$(RV).rockspec
30 # == YOU PROBABLY DO NOT NEED TO CHANGE ANYTHING BELOW =======================
32 # Platform specific differences
34 ifeq ($(SYSTEM), Cygwin)
41 # Cygwin: need to link against Lua libraries
46 ifeq ($(SYSTEM), Darwin)
50 LIBDIR = /usr/local/lib
52 LUABIN=$(LUA)/bin/lua$V
53 LUAINC=$(LUA)/include/lua/$(LV)
57 LUABIN=$(LUA)/bin/lua$V
58 LUAINC=$(LUA)/include/lua/$(LV)
62 NETSNMP_CONFIG=/usr/local/Cellar/net-snmp/5.9.4/bin/net-snmp-config
63 # net-snmp path - NetSNMP from MacPorts version 5.9
64 # NETSNMP_CONFIG=/usr/bin/net-snmp-config
65 # net-snmp path - MacOs built-in NetSNMP version 5.6
66 # NETSNMP_CONFIG=/usr/bin/net-snmp-config
70 LUAINC=$(LUA)/include/lua$(LV)
71 LUABIN=$(LUA)/bin/lua$(LV)
76 NETSNMP_CONFIG=/usr/bin/net-snmp-config
83 #DEFCOMPAT=-DLUA_COMPAT_ALL
85 # Current Version of LuaSNMP
89 LUASNMP_SO=snmp.$(EXT).$(VERSION)
92 DEF = -DUSE_SNMPTRAPD $(DEFCOMPAT) -DVERSION='"$(VERSION)"' -DSYSTEM='"$(SYSTEM)"' $(PLATFORM)
96 # CFLAGS = $(DEF) $(shell net-snmp-config --cflags) -I$(LUAINC) -fPIC -Wall -ggdb
97 CFLAGS = $(DEF) $(shell $(NETSNMP_CONFIG) --cflags) -I$(LUAINC) -fPIC -Wall -ggdb
99 # CFLAGS = $(DEF) $(shell net-snmp-config --cflags) -I$(LUAINC) -fPIC -Wall -O2
100 CFLAGS = $(DEF) $(shell $(NETSNMP_CONFIG) --cflags) -I$(LUAINC) -fPIC -Wall -O2
102 ifeq (Darwin, $(SYSTEM))
103 LDFLAGS= $(OPT) -dynamiclib -undefined dynamic_lookup -L$(LUALIB) -L$(LIBDIR)
105 LDFLAGS = $(shell $(NETSNMP_CONFIG) --ldflags) -O -shared -fPIC
107 #LIBS += $(shell net-snmp-config --libs) -lcrypto
108 LIBS += $(shell $(NETSNMP_CONFIG) --libs) -lcrypto
112 EXPORTDIR = $(HOME)/exports
113 DISTNAME = $(MODULE)-$(VERSION)
114 DISTARCH = $(DISTNAME).tar.gz
115 CVSMODULE = lua/lua-$(LV)/modules/$(MODULE)
116 SVNMODULE = $(MODULE)-$(VERSION)