Makefile, util-src/Makefile: Add .PHONY, reorganise util-src/Makefile
[prosody.git] / util-src / Makefile
1
2 include ../config.unix
3
4 LUA_SUFFIX?=5.1
5 LUA_INCDIR?=/usr/include/lua$(LUA_SUFFIX)
6 LUA_LIB?=lua$(LUA_SUFFIX)
7 IDN_LIB?=idn
8 OPENSSL_LIB?=crypto
9 CC?=gcc
10 CXX?=g++
11 LD?=gcc
12
13 .PHONY: all install clean
14 .SUFFIXES: .c .o .so
15
16 all: encodings.so hashes.so pposix.so signal.so
17
18 install: encodings.so hashes.so pposix.so signal.so
19         install *.so ../util/
20
21 clean:
22         rm -f *.o
23         rm -f *.so
24         rm -f ../util/*.so
25
26 encodings.so: encodings.o
27         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
28         $(CC) -o $@ $< $(LDFLAGS) $(IDNA_LIBS)
29
30 hashes.so: hashes.o
31         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
32         $(CC) -o $@ $< $(LDFLAGS) -l$(OPENSSL_LIB)
33
34 .c.o:
35         $(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o $@ $<
36
37 .o.so:
38         MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
39         $(LD) -o $@ $< $(LDFLAGS)
40