lua-symmetric

Symmetric crypto for Lua
Log | Files | Refs

Makefile.mess (1028B)


      1 # Let Luarocks point us to the right headers
      2 ifdef LUA_INCDIR
      3 	CFLAGS += -I$(LUA_INCDIR)
      4 endif
      5 
      6 # OS detection
      7 uname ?= $(shell uname -s)
      8 
      9 ifneq ($(uname),Darwin)
     10 	LDFLAGS += -shared
     11 else
     12 	LDFLAGS += -bundle -undefined dynamic_lookup
     13 endif
     14 
     15 ifneq ($(uname),OpenBSD)
     16 	# This is more or less what libressl does
     17 	# See http://openbsd.cs.toronto.edu/cgi-bin/cvsweb/src/lib/libssl/src/crypto/mem_clr.c?rev=1.4&content-type=text/x-cvsweb-markup
     18 	CFLAGS += -DOPENSSL_cleanse=explicit_bzero
     19 
     20 	# GCC whines without this. Assume everyone has strndup anyway
     21 	CFLAGS += -DHAVE_STRNDUP
     22 
     23 	CFLAGS += -Iinclude
     24 
     25 	SRCS += compat/safebfuns.c
     26 	SRCS += compat/arc4random/arc4random.c
     27 
     28 	ifeq ($(uname),Linux)
     29 		SRCS += compat/sha/sha512.c
     30 		SRCS += compat/getentropy/getentropy_linux.c
     31 		LDFLAGS += -lrt
     32 	endif
     33 
     34 	ifeq ($(uname),Darwin)
     35 		SRCS += compat/getentropy/getentropy_osx.c
     36 	endif
     37 
     38 	ifeq ($(uname),FreeBSD)
     39 		SRCS += compat/getentropy/getentropy_freebsd.c
     40 	endif
     41 endif
     42 
     43 compat/safebfuns.o: compat/safebfuns.c
     44 	$(CC) $(CFLAGS) -O0 -c -o $@ $^