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
|
|
|
|
|
|
|
|
SRCS = $(sort $(wildcard src/*.c))
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
LOBJS = $(OBJS:.o=.lo)
|
|
|
|
|
2011-11-06 16:46:11 +00:00
|
|
|
CFLAGS += -Wall -O0 -g -std=c99 -D_GNU_SOURCE -pipe -DTHREAD_SAFE
|
|
|
|
LDFLAGS = -shared -fPIC -ldl -lpthread
|
2011-09-03 23:45:16 +00:00
|
|
|
INC =
|
|
|
|
PIC = -fPIC -O0
|
|
|
|
AR = $(CROSS_COMPILE)ar
|
|
|
|
RANLIB = $(CROSS_COMPILE)ranlib
|
|
|
|
|
2011-11-06 13:07:38 +00:00
|
|
|
LDSO_PATHNAME = libproxychains4.so
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
-include config.mak
|
|
|
|
|
|
|
|
CFLAGS_MAIN=-DLIB_DIR=\"$(libdir)\"
|
|
|
|
|
|
|
|
|
|
|
|
all: $(ALL_LIBS) $(ALL_TOOLS)
|
|
|
|
|
|
|
|
#install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(DESTDIR)$(LDSO_PATHNAME)
|
|
|
|
install:
|
2011-11-06 13:07:38 +00:00
|
|
|
install -D -m 755 $(PXCHAINS) $(bindir)/$(PXCHAINS)
|
|
|
|
install -D -m 644 $(LDSO_PATHNAME) $(libdir)
|
|
|
|
install -D -m 644 src/proxychains.conf $(prefix)/etc
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f $(LOBJS)
|
|
|
|
rm -f $(ALL_LIBS) lib/*.[ao] lib/*.so
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) -c -o $@ $<
|
|
|
|
|
|
|
|
%.lo: %.c
|
|
|
|
$(CC) $(CFLAGS) $(CFLAGS_MAIN) $(INC) $(PIC) -c -o $@ $<
|
|
|
|
|
2011-11-06 13:07:38 +00:00
|
|
|
$(LDSO_PATHNAME): $(LOBJS)
|
|
|
|
$(CC) $(LDFLAGS) -Wl,-soname=$(LDSO_PATHNAME) -o $@ $(LOBJS)
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
$(ALL_TOOLS): $(OBJS)
|
2011-11-06 13:07:38 +00:00
|
|
|
$(CC) src/main.o -o $(PXCHAINS)
|
2011-09-03 23:45:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all clean install
|