rename rocksock_ssl.c to rocksock_openssl.c
[rofl0r-rocksock.git] / Makefile
blob778c8d224c93446537badf64d22a9d81afbb610b
2 # Makefile for proxychains (requires GNU make), stolen from musl
4 # Use config.mak to override any of the following variables.
5 # Do not make changes here.
7 prefix = /usr/local
8 exec_prefix = $(prefix)
9 bindir = $(exec_prefix)/bin
10 includedir = $(prefix)/include
11 libdir = $(prefix)/lib
13 SRCS = $(sort $(wildcard *.c))
14 OBJS = $(SRCS:.c=.o)
15 LOBJS = $(OBJS:.o=.lo)
16 SONAME = librocksock.so
17 ANAME = librocksock.a
19 #EX_SRCS = $(sort $(wildcard examples/*.c))
20 EX_SRCS = examples/rocksock_test2.c examples/rocksock_test3.c
21 EX_PROGS = $(EX_SRCS:.c=.out)
23 CFLAGS += -Wall -std=c99 -D_GNU_SOURCE -pipe
24 INC =
25 PIC = -fPIC -shared
26 AR = $(CROSS_COMPILE)ar
27 RANLIB = $(CROSS_COMPILE)ranlib
28 ALL_LIBS = $(ANAME)
29 ALL_INCLUDES = rocksock.h
31 -include config.mak
33 examples: $(ALL_LIBS) $(EX_PROGS)
36 all: $(ALL_LIBS)
38 install: $(ALL_LIBS:lib%=$(DESTDIR)$(libdir)/lib%) $(ALL_INCLUDES:%=$(DESTDIR)$(includedir)/%)
40 $(DESTDIR)$(libdir)/%: $(ALL_LIBS)
41 install -D -m 644 $< $@
43 $(DESTDIR)$(lincludedir)/%: $(ALL_INCLUDES)
44 install -D -m 644 $< $@
46 $(SONAME): $(LOBJS)
47 $(CC) $(PIC) -Wl,-soname=$(SONAME) -o $(SONAME) $(LOBJS) $(LDFLAGS)
49 $(ANAME): $(OBJS)
50 rm -f $@
51 $(AR) rc $@ $(OBJS)
52 $(RANLIB) $@
54 clean:
55 rm -f $(OBJS)
56 rm -f $(LOBJS)
57 rm -f $(EX_PROGS)
59 %.o: %.c config.mak
60 $(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -c -o $@ $<
62 %.lo: %.c config.mak
63 $(CC) $(CPPFLAGS) $(CFLAGS) $(PIC) $(INC) -c -o $@ $<
65 examples/micserver.out: LDFLAGS+=-lasound
67 %.out: %.c $(ANAME)
68 $(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -o $@ $< -L. -lrocksock $(LDFLAGS)
71 .PHONY: all clean install