moonbridge

annotate Makefile @ 139:f148bd2b3d05

Added moonbridge_io.h to Makefile; Added stub for moonbridge_websocket.c (with base64'd SHA-1)
author jbe
date Sat Apr 18 01:33:38 2015 +0200 (2015-04-18)
parents 22dbb9d09f02
children 43387f11b096
rev   line source
jbe@0 1 # BSD Makefile
jbe@0 2 # On GNU systems, use bmake.
jbe@0 3
jbe@24 4 PLATFORM != uname
jbe@24 5
jbe@24 6 .if $(PLATFORM) == "FreeBSD"
jbe@0 7 # Default configuration for FreeBSD
jbe@0 8 LUA_INCLUDE ?= /usr/local/include/lua52
jbe@0 9 LUA_LIBDIR ?= /usr/local/lib
jbe@0 10 LUA_LIBRARY ?= lua-5.2
jbe@0 11 UTIL_FLAGS ?= -lutil
jbe@0 12
jbe@24 13 .elif $(PLATFORM) == "Linux"
jbe@16 14 # Distinguish between different Linux distributions
jbe@24 15 DISTRIBUTION != lsb_release -i -s
jbe@25 16 .if $(DISTRIBUTION) == "Debian"
jbe@25 17 # Default configuration for Debian
jbe@25 18 LUA_INCLUDE ?= /usr/include/lua5.2
jbe@25 19 LUA_LIBDIR ?= /usr/lib
jbe@25 20 LUA_LIBRARY ?= lua5.2
jbe@25 21 UTIL_FLAGS ?= -ldl -lbsd -lrt
jbe@25 22 .elif $(DISTRIBUTION) == "Ubuntu"
jbe@16 23 # Default configuration for Ubuntu
jbe@16 24 LUA_INCLUDE ?= /usr/include/lua5.2
jbe@16 25 LUA_LIBDIR ?= /usr/lib/x86_64-linux-gnu
jbe@16 26 LUA_LIBRARY ?= lua5.2
jbe@16 27 UTIL_FLAGS ?= -ldl -lbsd
jbe@16 28 .else
jbe@16 29 # Default configuration for other Linux distributions
jbe@0 30 LUA_INCLUDE ?= /usr/include
jbe@0 31 LUA_LIBDIR ?= /usr/lib
jbe@0 32 LUA_LIBRARY ?= lua
jbe@0 33 UTIL_FLAGS ?= -ldl -lbsd
jbe@16 34 .endif
jbe@0 35
jbe@0 36 .else
jbe@0 37 # Default configuration for other systems
jbe@0 38 LUA_INCLUDE ?= /usr/include
jbe@0 39 LUA_LIBDIR ?= /usr/lib
jbe@0 40 LUA_LIBRARY ?= lua
jbe@0 41 UTIL_FLAGS ?= -lutil
jbe@0 42
jbe@0 43 .endif
jbe@0 44
jbe@8 45 .ifdef MOONBR_LUA_PATH
jbe@8 46 MOONBR_LUA_PATH_DEFINE = "-DMOONBR_LUA_PATH=\"$(MOONBR_LUA_PATH)\""
jbe@8 47 .endif
jbe@8 48
jbe@9 49 .ifdef MOONBR_LUA_CPATH
jbe@9 50 MOONBR_LUA_CPATH_DEFINE = "-DMOONBR_LUA_CPATH=\"$(MOONBR_LUA_CPATH)\""
jbe@9 51 .endif
jbe@9 52
jbe@139 53 all:: moonbridge moonbridge_io.so moonbridge_websocket.so
jbe@79 54
jbe@79 55 moonbridge: moonbridge.c moonbridge_io.h moonbridge_io.o
jbe@79 56 cc -Wall -Wno-unused-result -O2 -Wl,-E -I $(LUA_INCLUDE) -L $(LUA_LIBDIR) -o moonbridge $(MOONBR_LUA_PATH_DEFINE) $(MOONBR_LUA_CPATH_DEFINE) moonbridge.c -lm -l$(LUA_LIBRARY) $(UTIL_FLAGS) moonbridge_io.o
jbe@0 57
jbe@139 58 moonbridge_io.o: moonbridge_io.c moonbridge_io.h
jbe@79 59 cc -c -Wall -O2 -fPIC -I $(LUA_INCLUDE) -o moonbridge_io.o moonbridge_io.c
jbe@79 60
jbe@79 61 moonbridge_io.so: moonbridge_io.o
jbe@79 62 ld -shared -o moonbridge_io.so moonbridge_io.o
jbe@0 63
jbe@139 64 moonbridge_websocket.o: moonbridge_websocket.c
jbe@139 65 cc -c -Wall -O2 -fPIC -I $(LUA_INCLUDE) -o moonbridge_websocket.o moonbridge_websocket.c
jbe@139 66
jbe@139 67 moonbridge_websocket.so: moonbridge_websocket.o
jbe@139 68 ld -shared -o moonbridge_websocket.so -lmd moonbridge_websocket.o
jbe@139 69
jbe@0 70 clean::
jbe@139 71 rm -f moonbridge moonbridge_io.o moonbridge_websocket.so
jbe@0 72

Impressum / About Us