2011-09-03 23:45:16 +00:00
|
|
|
#
|
|
|
|
# Makefile for proxychains (requires GNU make), stolen from musl
|
|
|
|
#
|
|
|
|
# Use config.mak to override any of the following variables.
|
|
|
|
# Do not make changes here.
|
|
|
|
#
|
|
|
|
|
|
|
|
exec_prefix = /usr/local
|
|
|
|
bindir = $(exec_prefix)/bin
|
|
|
|
|
|
|
|
prefix = /usr/local/
|
|
|
|
includedir = $(prefix)/include
|
|
|
|
libdir = $(prefix)/lib
|
2012-01-30 17:26:38 +00:00
|
|
|
sysconfdir=$(prefix)/etc
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
SRCS = $(sort $(wildcard src/*.c))
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
2014-07-22 12:10:08 +00:00
|
|
|
LOBJS = src/nameinfo.o src/version.o \
|
2012-12-17 21:17:00 +00:00
|
|
|
src/core.o src/common.o src/libproxychains.o src/shm.o \
|
2012-11-08 00:18:19 +00:00
|
|
|
src/allocator_thread.o src/ip_type.o src/stringdump.o \
|
2014-11-14 11:33:58 +00:00
|
|
|
src/hostsreader.o src/hash.o src/debug.o
|
2011-09-03 23:45:16 +00:00
|
|
|
|
2014-07-22 12:10:08 +00:00
|
|
|
GENH = src/version.h
|
|
|
|
|
2012-11-07 20:28:09 +00:00
|
|
|
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe
|
2012-12-16 01:39:28 +00:00
|
|
|
NO_AS_NEEDED = -Wl,--no-as-needed
|
2012-12-25 18:08:05 +00:00
|
|
|
LIBDL = -ldl
|
|
|
|
LDFLAGS = -shared -fPIC $(NO_AS_NEEDED) $(LIBDL) -lpthread
|
2011-09-03 23:45:16 +00:00
|
|
|
INC =
|
2012-01-24 06:29:34 +00:00
|
|
|
PIC = -fPIC
|
2011-09-03 23:45:16 +00:00
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
RANLIB = $(CROSS_COMPILE)ranlib
|
|
|
|
|
2012-01-27 19:30:44 +00:00
|
|
|
LDSO_SUFFIX = so
|
2012-01-27 19:48:24 +00:00
|
|
|
LD_SET_SONAME = -Wl,-soname=
|
2014-07-22 12:32:27 +00:00
|
|
|
INSTALL = ./tools/install.sh
|
2012-01-27 19:30:44 +00:00
|
|
|
|
|
|
|
LDSO_PATHNAME = libproxychains4.$(LDSO_SUFFIX)
|
2011-11-06 13:07:38 +00:00
|
|
|
|
|
|
|
SHARED_LIBS = $(LDSO_PATHNAME)
|
2011-09-03 23:45:16 +00:00
|
|
|
ALL_LIBS = $(SHARED_LIBS)
|
2011-11-06 13:07:38 +00:00
|
|
|
PXCHAINS = proxychains4
|
|
|
|
ALL_TOOLS = $(PXCHAINS)
|
2014-07-22 12:32:27 +00:00
|
|
|
ALL_CONFIGS = src/proxychains.conf
|
2011-09-03 23:45:16 +00:00
|
|
|
|
2013-01-06 18:26:01 +00:00
|
|
|
-include config.mak
|
2011-09-03 23:45:16 +00:00
|
|
|
|
2012-01-27 19:48:24 +00:00
|
|
|
CFLAGS+=$(USER_CFLAGS) $(MAC_CFLAGS)
|
2012-01-30 17:29:35 +00:00
|
|
|
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\" -DSYSCONFDIR=\"$(sysconfdir)\" -DDLL_NAME=\"$(LDSO_PATHNAME)\"
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
all: $(ALL_LIBS) $(ALL_TOOLS)
|
|
|
|
|
2014-07-22 12:32:27 +00:00
|
|
|
install: install-libs install-tools
|
2012-07-16 00:29:04 +00:00
|
|
|
|
2014-07-22 12:32:27 +00:00
|
|
|
$(DESTDIR)$(bindir)/%: %
|
|
|
|
$(INSTALL) -D -m 755 $< $@
|
|
|
|
|
|
|
|
$(DESTDIR)$(libdir)/%: %
|
|
|
|
$(INSTALL) -D -m 644 $< $@
|
|
|
|
|
2014-07-22 15:21:11 +00:00
|
|
|
$(DESTDIR)$(sysconfdir)/%: src/%
|
2014-07-22 12:32:27 +00:00
|
|
|
$(INSTALL) -D -m 644 $< $@
|
|
|
|
|
|
|
|
install-libs: $(ALL_LIBS:%=$(DESTDIR)$(libdir)/%)
|
|
|
|
install-tools: $(ALL_TOOLS:%=$(DESTDIR)$(bindir)/%)
|
|
|
|
install-config: $(ALL_CONFIGS:src/%=$(DESTDIR)$(sysconfdir)/%)
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
clean:
|
2012-01-24 06:29:34 +00:00
|
|
|
rm -f $(ALL_LIBS)
|
|
|
|
rm -f $(ALL_TOOLS)
|
2011-09-03 23:45:16 +00:00
|
|
|
rm -f $(OBJS)
|
2014-07-22 12:10:08 +00:00
|
|
|
rm -f $(GENH)
|
|
|
|
|
|
|
|
src/version.h: $(wildcard VERSION .git)
|
|
|
|
printf '#define VERSION "%s"\n' "$$(sh tools/version.sh)" > $@
|
|
|
|
|
|
|
|
src/version.o: src/version.h
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
%.o: %.c
|
2014-02-02 08:49:21 +00:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
|
2011-09-03 23:45:16 +00:00
|
|
|
|
2011-11-06 13:07:38 +00:00
|
|
|
$(LDSO_PATHNAME): $(LOBJS)
|
2012-01-27 19:48:24 +00:00
|
|
|
$(CC) $(LDFLAGS) $(LD_SET_SONAME)$(LDSO_PATHNAME) -o $@ $(LOBJS)
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
$(ALL_TOOLS): $(OBJS)
|
2012-07-08 21:32:50 +00:00
|
|
|
$(CC) src/main.o src/common.o -o $(PXCHAINS)
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
|
2014-07-22 12:32:27 +00:00
|
|
|
.PHONY: all clean install install-config install-libs install-tools
|