lua-arc4random

Cryptographically secure PRNG for Lua
Log | Files | Refs | README

Makefile.mess (1135B)


      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 ifeq ($(uname),OpenBSD)
     16 else ifeq ($(uname),NetBSD)
     17 else
     18 	# This is more or less what libressl does
     19 	# 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
     20 	CFLAGS += -DOPENSSL_cleanse=explicit_bzero
     21 
     22 	CFLAGS += -Icompat/include
     23 
     24 	SRCS += compat/arc4random/arc4random.c
     25 	SRCS += compat/arc4random/arc4random_uniform.c
     26 	SRCS += compat/safebfuns.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),SunOS)
     35 		SRCS += compat/sha/sha512.c
     36 		SRCS += compat/getentropy/getentropy_solaris.c
     37 	endif
     38 
     39 	ifeq ($(uname),Darwin)
     40 		SRCS += compat/getentropy/getentropy_osx.c
     41 	endif
     42 
     43 	ifeq ($(uname),FreeBSD)
     44 		SRCS += compat/getentropy/getentropy_freebsd.c
     45 	endif
     46 endif
     47 
     48 compat/safebfuns.o: compat/safebfuns.c
     49 	$(CC) $(CFLAGS) -O0 -c -o $@ $^