add microphone server/client examples
[rofl0r-rocksock.git] / Makefile
blob753c53ba43114a7fd0ad2f477284dd68a3d94410
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_PROGS = $(EX_SRCS:.c=.out)
22 CFLAGS += -Wall -std=c99 -D_GNU_SOURCE -pipe
23 INC =
24 PIC = -fPIC -shared
25 AR = $(CROSS_COMPILE)ar
26 RANLIB = $(CROSS_COMPILE)ranlib
27 ALL_LIBS = $(ANAME)
28 ALL_INCLUDES = rocksock.h
30 -include config.mak
32 examples: $(ALL_LIBS) $(EX_PROGS)
35 all: $(ALL_LIBS)
37 install: $(ALL_LIBS:lib%=$(DESTDIR)$(libdir)/lib%) $(ALL_INCLUDES:%=$(DESTDIR)$(includedir)/%)
39 $(DESTDIR)$(libdir)/%: $(ALL_LIBS)
40 install -D -m 644 $< $@
42 $(DESTDIR)$(lincludedir)/%: $(ALL_INCLUDES)
43 install -D -m 644 $< $@
45 $(SONAME): $(LOBJS)
46 $(CC) $(PIC) -Wl,-soname=$(SONAME) -o $(SONAME) $(LOBJS) $(LDFLAGS)
48 $(ANAME): $(OBJS)
49 rm -f $@
50 $(AR) rc $@ $(OBJS)
51 $(RANLIB) $@
53 clean:
54 rm -f $(OBJS)
55 rm -f $(LOBJS)
56 rm -f $(EX_PROGS)
58 %.o: %.c
59 $(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -c -o $@ $<
61 %.lo: %.c
62 $(CC) $(CPPFLAGS) $(CFLAGS) $(PIC) $(INC) -c -o $@ $<
64 %.out: %.c
65 $(CC) $(CPPFLAGS) $(CFLAGS) $(INC) -o $@ $< -l:librocksock.a $(LDFLAGS)
68 .PHONY: all clean install