summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWilliam Ahern <william@server.local>2013-03-13 19:35:24 -0700
committerWilliam Ahern <william@server.local>2013-03-13 19:35:24 -0700
commit5f3993fbf20065a9cc4e5123340b3df0337c8c01 (patch)
treee79db7da9494c8ee1434835fa18e8f6dd8218696 /Makefile
parent50414ab3f72bc06b0d2ea3781f20a7aa00a118ab (diff)
downloadluaossl-5f3993fbf20065a9cc4e5123340b3df0337c8c01.tar.gz
luaossl-5f3993fbf20065a9cc4e5123340b3df0337c8c01.tar.bz2
luaossl-5f3993fbf20065a9cc4e5123340b3df0337c8c01.zip
-n
rename to GNUmakefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile163
1 files changed, 0 insertions, 163 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index d484ff5..0000000
--- a/Makefile
+++ /dev/null
@@ -1,163 +0,0 @@
1prefix = /usr/local
2bindir = $(prefix)/bin
3libdir = $(prefix)/lib
4datadir = $(prefix)/share
5includedir = $(prefix)/include
6luainclude =
7luapath =
8luacpath =
9LUAC =
10
11# backwards compatible install paths
12ifneq ($(origin lua52include), undefined)
13luainclude = $(lua52include)
14endif
15
16ifneq ($(origin lua52path), undefined)
17luapath = $(lua52path)
18endif
19
20ifneq ($(origin lua52cpath), undefined)
21luacpath = $(lua52cpath)
22endif
23
24
25# call helper to derive our Lua paths
26ENV = CC CPPFLAGS prefix bindir libdir datadir includedir \
27 luainclude luapath luacpath LUAC
28$(shell env $(foreach V, $(ENV), $(V)="$(call $(V))") ../mk/lua.path make > .config)
29include .config
30
31
32VENDOR.OS = $(shell ../mk/vendor.os)
33VENDOR.CC = $(shell env CC="${CC}" ../mk/vendor.cc)
34
35ifneq ($(luainclude),)
36CPPFLAGS = -I$(luainclude)
37endif
38
39ifeq ($(VENDOR.CC), sunpro)
40DFLAGS = -g
41CFLAGS = -xcode=pic13 $(DFLAGS)
42CPPFLAGS += -DOPENSSL_NO_EC
43else
44DFLAGS = -g -Wall -Wextra -Wno-deprecated-declarations -Wno-unused
45CFLAGS = -fPIC $(DFLAGS)
46endif
47
48LDFLAGS = -lssl -lcrypto
49
50ifeq ($(VENDOR.OS), Darwin)
51SOFLAGS = -bundle -undefined dynamic_lookup
52else
53SOFLAGS = -shared
54endif
55
56
57all: openssl.so
58
59openssl.so: openssl.o
60 $(CC) -o $@ $^ $(SOFLAGS) $(LDFLAGS)
61
62openssl.o: openssl.c compat52.h
63 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
64
65
66install: $(DESTDIR)$(luacpath)/_openssl.so \
67 $(DESTDIR)$(luapath)/openssl/bignum.lua \
68 $(DESTDIR)$(luapath)/openssl/pubkey.lua \
69 $(DESTDIR)$(luapath)/openssl/x509.lua \
70 $(DESTDIR)$(luapath)/openssl/x509/name.lua \
71 $(DESTDIR)$(luapath)/openssl/x509/altname.lua \
72 $(DESTDIR)$(luapath)/openssl/x509/chain.lua \
73 $(DESTDIR)$(luapath)/openssl/x509/store.lua \
74 $(DESTDIR)$(luapath)/openssl/ssl/context.lua \
75 $(DESTDIR)$(luapath)/openssl/ssl.lua \
76 $(DESTDIR)$(luapath)/openssl/digest.lua \
77 $(DESTDIR)$(luapath)/openssl/hmac.lua \
78 $(DESTDIR)$(luapath)/openssl/cipher.lua
79
80$(DESTDIR)$(luacpath)/_openssl.so: openssl.so
81 mkdir -p $(@D)
82 cp -p $< $@
83
84$(DESTDIR)$(luapath)/openssl/bignum.lua: openssl.bignum.lua
85 mkdir -p $(@D)
86 cp -p $< $@
87
88$(DESTDIR)$(luapath)/openssl/pubkey.lua: openssl.pubkey.lua
89 mkdir -p $(@D)
90 cp -p $< $@
91
92$(DESTDIR)$(luapath)/openssl/x509.lua: openssl.x509.lua
93 mkdir -p $(@D)
94 cp -p $< $@
95
96$(DESTDIR)$(luapath)/openssl/x509/name.lua: openssl.x509.name.lua
97 mkdir -p $(@D)
98 cp -p $< $@
99
100$(DESTDIR)$(luapath)/openssl/x509/altname.lua: openssl.x509.altname.lua
101 mkdir -p $(@D)
102 cp -p $< $@
103
104$(DESTDIR)$(luapath)/openssl/x509/chain.lua: openssl.x509.chain.lua
105 mkdir -p $(@D)
106 cp -p $< $@
107
108$(DESTDIR)$(luapath)/openssl/x509/store.lua: openssl.x509.store.lua
109 mkdir -p $(@D)
110 cp -p $< $@
111
112$(DESTDIR)$(luapath)/openssl/ssl/context.lua: openssl.ssl.context.lua
113 mkdir -p $(@D)
114 cp -p $< $@
115
116$(DESTDIR)$(luapath)/openssl/ssl.lua: openssl.ssl.lua
117 mkdir -p $(@D)
118 cp -p $< $@
119
120$(DESTDIR)$(luapath)/openssl/digest.lua: openssl.digest.lua
121 mkdir -p $(@D)
122 cp -p $< $@
123
124$(DESTDIR)$(luapath)/openssl/hmac.lua: openssl.hmac.lua
125 mkdir -p $(@D)
126 cp -p $< $@
127
128$(DESTDIR)$(luapath)/openssl/cipher.lua: openssl.cipher.lua
129 mkdir -p $(@D)
130 cp -p $< $@
131
132
133.PHONY: clean clean~ help
134
135clean:
136 rm -f *.so *.o
137 rm -f .config
138
139clean~: clean
140 rm -f *~
141
142help:
143 @echo "Available targets:"
144 @echo ""
145 @echo " all - build all binary targets"
146 @echo "openssl.so - build openssl.so module"
147 @echo " install - install openssl modules"
148 @echo " clean - rm binary targets, object files, debugging symbols, etc"
149 @echo " clean~ - clean + rm *~"
150 @echo " help - echo this help message"
151 @echo ""
152 @echo "Some important Make variables:"
153 @echo ""
154 @echo " prefix - path to install root"
155 @echo 'luainclude - path to Lua headers ($$(prefix)/include/lua/5.2)'
156 @echo ' luapath - install path for Lua modules ($$(prefix)/share/lua/5.2)'
157 @echo ' luacpath - install path for Lua C modules ($$(prefix)/lib/lua/5.2)'
158 @echo ' LUAC - path to luac utility ($$(bindir)/luac)'
159 @echo ""
160 @echo "(NOTE: all the common GNU-style paths are supported, including"
161 @echo "prefix, bindir, libdir, datadir, includedir, and DESTDIR.)"
162 @echo ""
163 @echo "Report bugs to <william@25thandClement.com>"