-
Notifications
You must be signed in to change notification settings - Fork 108
/
Makefile
executable file
·69 lines (55 loc) · 1.26 KB
/
Makefile
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
59
60
61
62
63
64
65
66
67
68
69
# ftplibpp makefile
SONAME = 2
SOVERSION = $(SONAME).0
TARGETS = libftp++.a libftp++.so
OBJECTS = ftplib.o
SOURCES = ftplib.cpp
CFLAGS = -Wall $(DEBUG) -I. $(INCLUDES) $(DEFINES)
LDFLAGS = -L.
DEPFLAGS =
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
SOFLAG=install_name
ifndef NOSSL
LIBS = -lssl -lcrypto
else
LIBS =
endif
endif
ifeq ($(UNAME), Linux)
SOFLAG=soname
ifndef NOSSL
LIBS = -lssl
else
LIBS =
endif
endif
all : $(TARGETS)
clean :
rm -f $(OBJECTS) core *.bak
rm -rf unshared
rm -f $(TARGETS) .depend
rm -f libftp.so.*
uninstall :
rm -f /usr/local/lib/libftp.so.*
rm -f /usr/local/include/libftp.h
install : all
install -m 644 libftp.so.$(SOVERSION) /usr/local/lib
install -m 644 ftplib.h /usr/local/include
(cd /usr/local/lib && \
ln -sf libftp.so.$(SOVERSION) libftp.so.$(SONAME) && \
ln -sf libftp.so.$(SONAME) libftp.so)
depend :
$(CC) $(CFLAGS) -M $(SOURCES) > .depend
ftplib.o: ftplib.cpp ftplib.h
$(CC) -c $(CFLAGS) -fPIC -D_REENTRANT -DNOSSL $< -o $@
libftp++.a: ftplib.o
ar -rcs $@ $<
libftp.so.$(SOVERSION): ftplib.o
$(CC) -shared -Wl,-$(SOFLAG),libftp.so.$(SONAME) $(LIBS) -lc -o $@ $<
libftp++.so: libftp.so.$(SOVERSION)
ln -sf $< libftp.so.$(SONAME)
ln -sf $< $@
ifeq (.depend,$(wildcard .depend))
include .depend
endif