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
|
SONAME = 3
SOVERSION = $(SONAME).0
TARGETS = qftp libftp.a libftp.so
OBJECTS = qftp.o ftplib.o
SOURCES = qftp.c ftplib.c
CFLAGS = -Wall $(DEBUG) -I. $(INCLUDES)
LDFLAGS = -L.
DEPFLAGS =
all : $(TARGETS)
clean :
rm -f $(OBJECTS) core *.bak
rm -rf unshared
clobber : clean
rm -f $(TARGETS) .depend
rm -f libftp.so.*
kit : clobber
tar cfz $(PWD).tar.gz $(PWD)
depend :
ifeq ($(SYSTYPE),OSF1)
touch .depend
makedepend $(DEPFLAGS) -- $(CFLAGS) -- $(SOURCES)
endif
ifeq ($(SYSTYPE),Linux)
$(CC) $(CFLAGS) -M $(SOURCES) > .depend
endif
# build without -fPIC
unshared/ftplib.o: ftplib.c ftplib.h
-mkdir unshared
$(CC) -c $(CFLAGS) -D_REENTRANT $< -o $@
ftplib.o: ftplib.c ftplib.h
$(CC) -c $(CFLAGS) -fPIC -D_REENTRANT $< -o $@
libftp.a: unshared/ftplib.o
ar -rcvs $@ $<
libftp.so.$(SOVERSION): ftplib.o
$(CC) -shared -Wl,-soname,libftp.so.$(SONAME) -lc -o $@ $<
libftp.so: libftp.so.$(SOVERSION)
ln -sf $< libftp.so.$(SONAME)
ln -sf $< $@
qftp : qftp.o libftp.so ftplib.h
$(CC) $(LDFLAGS) -o $@ $< -lftp
ifeq (.depend,$(wildcard .depend))
include .depend
endif
|