File: Makefile

package info (click to toggle)
socks4-server 4.3.beta2-20
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 1,512 kB
  • ctags: 1,778
  • sloc: ansic: 19,305; makefile: 399; sh: 52
file content (58 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# DO NOT start 'make' in this directory. Go to the top
# directory of the SOCKS package and do it from there!

#==============================================================================

OBJS =	Rconnect.o SendGetDst.o porttoserv.o utils.o \
	Rbind.o Rgethostbyname.o Rselect.o \
	null_syslog.o shell_cmd.o \
	socks_ckcf.o socks_rdconf.o \
	socks_rdfz.o socks_wrfz.o \
	socks_dumpcf.o sockd_dumpcf.o sockd_dumprt.o \
	sockd_rdconf.o sockd_rdroute.o \
	$(GETPASS) $(STRDUP)

SOBJS = $(patsubst %.o,%.lo,$(OBJS))

LIB = libsocks.a
SLIB = libsocks.so.4.3
SLIBNAME = libsocks.so.4
CFLAGS = -I../include $(OPTIMIZE) $(OTHER_CFLAGS)

all: echocwd $(LIB) $(SLIB)

$(LIB): $(OBJS) ../include/socks.h ../Makefile
	rm -f $(LIB)
	ar rc $(LIB) $(OBJS)
	$(RANLIB) $(LIB)
#	ld -shared -o $(SLIB) -soname $(SLIBNAME) --whole-archive $(LIB)
#	gcc -shared -o $(SLIB) -Wl,-soname,$(SLIBNAME) -Wl,--whole-archive $(LIB) -Wl,--no-whole-archive -lc
#	ln -sf libsocks.so.4.3 libsocks.so.4
#	ln -sf libsocks.so.4.3 libsocks.so

$(SLIB): $(SOBJS) ../include/socks.h ../Makefile
	rm -f $(SLIB)
	gcc -shared -o $(SLIB) -Wl,-soname,$(SLIBNAME) -Wl,--whole-archive $(SOBJS) -Wl,--no-whole-archive -lc
	ln -sf libsocks.so.4.3 libsocks.so.4
	ln -sf libsocks.so.4.3 libsocks.so

%.lo: %.c
	$(CC) -fPIC $(CFLAGS) -c -o $@ $<

$(OBJS):: ../include/socks.h ../Makefile

install: echocwd $(LIB)
	-if [ -d $(LIB_DEST_DIR) ]; then \
	  ($(INSTALL) -m 644 $(LIB) $(LIB_DEST_DIR); \
	   $(RANLIB) -t $(LIB_DEST_DIR)/$(LIB)); fi

install.man: echocwd
	$(INSTALL) -m 444 ../doc/socks_clients.1 $(MAN_DEST_DIR)/man1
	$(INSTALL) -m 444 ../doc/socks.conf.5 $(MAN_DEST_DIR)/man5

clean: echocwd
	rm -f *.o *.lo $(LIB) libsocks.so* core

echocwd:
	@pwd