diff options
| author | William Ahern <william@server.local> | 2012-09-29 22:44:00 -0700 |
|---|---|---|
| committer | William Ahern <william@server.local> | 2012-09-29 22:44:00 -0700 |
| commit | 468c9871b58856dda00149a9dc45ecfb7283d67f (patch) | |
| tree | 20bace130aeedfa232c9eb648873b05cddab1796 /Makefile | |
| download | luaossl-468c9871b58856dda00149a9dc45ecfb7283d67f.tar.gz luaossl-468c9871b58856dda00149a9dc45ecfb7283d67f.tar.bz2 luaossl-468c9871b58856dda00149a9dc45ecfb7283d67f.zip | |
-n
start OpenSSL extension
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a7f829b --- /dev/null +++ b/Makefile | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | prefix = /usr/local/lua52 | ||
| 2 | libdir = $(prefix)/lib | ||
| 3 | datadir = $(prefix)/share | ||
| 4 | includedir = $(prefix)/include | ||
| 5 | lua52include = $(includedir)/lua/5.2 | ||
| 6 | lua52path = $(datadir)/lua/5.2 | ||
| 7 | lua52cpath = $(libdir)/lua/5.2 | ||
| 8 | |||
| 9 | LUAC = $(prefix)/bin/luac | ||
| 10 | |||
| 11 | VENDOR.OS = $(shell ../mk/vendor.os) | ||
| 12 | VENDOR.CC = $(shell env CC="${CC}" ../mk/vendor.cc) | ||
| 13 | |||
| 14 | |||
| 15 | CPPFLAGS = -I$(DESTDIR)$(lua52include) | ||
| 16 | DFLAGS = -Wall -Wextra -Wno-deprecated-declarations -Wno-unused | ||
| 17 | CFLAGS = -fPIC $(DFLAGS) | ||
| 18 | LDFLAGS = -lssl -lcrypto | ||
| 19 | |||
| 20 | ifeq ($(VENDOR.OS), Darwin) | ||
| 21 | SOFLAGS = -bundle -undefined dynamic_lookup | ||
| 22 | else | ||
| 23 | SOFLAGS = -shared | ||
| 24 | endif | ||
| 25 | |||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | all: openssl.so | ||
| 31 | |||
| 32 | openssl.so: openssl.o | ||
| 33 | $(CC) -o $@ $^ $(SOFLAGS) $(LDFLAGS) | ||
| 34 | |||
| 35 | openssl.o: openssl.c | ||
| 36 | $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< | ||
| 37 | |||
| 38 | |||
| 39 | .PHONY: clean clean~ | ||
| 40 | |||
| 41 | clean: | ||
| 42 | rm -f *.so *.o | ||
| 43 | |||
| 44 | clean~: clean | ||
| 45 | rm -f *~ | ||
