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)
|
2012-12-17 21:17:00 +00:00
|
|
|
LOBJS = src/nameinfo.o \
|
|
|
|
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 \
|
2013-06-23 05:12:25 +00:00
|
|
|
src/hostentdb.o src/hash.o src/debug.o
|
2011-09-03 23:45:16 +00:00
|
|
|
|
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=
|
|
|
|
INSTALL_FLAGS = -D -m
|
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)
|
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)
|
|
|
|
|
2012-07-16 00:29:04 +00:00
|
|
|
install-config:
|
2013-02-10 11:38:05 +00:00
|
|
|
install -d $(DESTDIR)$(sysconfdir)
|
|
|
|
install $(INSTALL_FLAGS) 644 src/proxychains.conf $(DESTDIR)$(sysconfdir)/
|
2012-07-16 00:29:04 +00:00
|
|
|
|
2011-09-03 23:45:16 +00:00
|
|
|
install:
|
2013-02-10 11:38:05 +00:00
|
|
|
install -d $(DESTDIR)$(bindir)/ $(DESTDIR)$(libdir)/
|
|
|
|
install $(INSTALL_FLAGS) 755 $(ALL_TOOLS) $(DESTDIR)$(bindir)/
|
|
|
|
install $(INSTALL_FLAGS) 644 $(ALL_LIBS) $(DESTDIR)$(libdir)/
|
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)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
|
|
|
|
|
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
|
|
|
|
|
|
|
|
2013-01-06 18:33:34 +00:00
|
|
|
.PHONY: all clean install install-config
|