#----------------------------------------------------------------------------- # # LibNcFTP makefile for the platform @OS@, on the host @host@. # #----------------------------------------------------------------------------- PKGNAME=libncftp VERSION=3.0.1 PREFIX=@prefix@ CC=@CC@ CFLAGS=@CFLAGS@ #CC=gcc #CFLAGS=-g -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wbad-function-cast -Wwrite-strings -Wconversion VPATH=@srcdir@ CPPFLAGS=-I. -I../Strn -I../sio @CPPFLAGS@ LIB=libncftp.a LIBSO=libncftp.so.2 LIBSOS=libncftp.so # Any -D definitions: DEFS=@DEFS@@NDEFS@ CFILES=open.c cmds.c util.c rcmd.c ftp.c io.c errno.c linelist.c glob.c OBJS=open.o cmds.o util.o rcmd.o ftp.o io.o errno.o linelist.o glob.o SOBJS=open.so cmds.so util.so rcmd.so ftp.so io.so errno.so linelist.so glob.so # LIBSET=@LIBSET@ LIBSET=$(LIB) SHELL=/bin/sh .SUFFIXES: .c .o .so all: $(LIBSET) ( cd ../sio ; $(MAKE) ) ( cd ../Strn ; $(MAKE) ) -[ -d ./samples/minincftp ] && cd ./samples/minincftp && $(MAKE) -[ -d ./samples/misc ] && cd ./samples/misc && $(MAKE) -[ -d ./samples/monkey ] && cd ./samples/monkey && $(MAKE) -[ -d ./samples/ncftpget ] && cd ./samples/ncftpget && $(MAKE) -[ -d ./samples/ncftpls ] && cd ./samples/ncftpls && $(MAKE) -[ -d ./samples/ncftpput ] && cd ./samples/ncftpput && $(MAKE) -[ -d ./samples/ncftpsyncput ] && cd ./samples/ncftpsyncput && $(MAKE) @echo 'Done.' $(LIB): $(OBJS) -@/bin/rm -f $(LIB) ar rv $(LIB) $(OBJS) -@chmod 644 $(LIB) -@@RANLIB@ $(LIB) @/bin/ls -l $(LIB) shared: $(LIBSO) so: $(LIBSO) $(LIBSO): $(SOBJS) /bin/rm -f $(LIBSO) $(LIBSOS) gcc -shared -Wl,-soname,$(LIBSO) -o $(LIBSO) $(SOBJS) /bin/ln -s $(LIBSO) $(LIBSOS) -@/bin/ls -l $(LIBSOS) $(LIBSO) soinstall: $(LIBSO) [ -d "$(PREFIX)/lib" ] || mkdir -m 755 "$(PREFIX)/lib" [ -d "$(PREFIX)/include" ] || mkdir -m 755 "$(PREFIX)/include" cp $(LIBSO) $(PREFIX)/lib/$(LIBSO) ( cd $(PREFIX)/lib ; /bin/rm -f $(LIBSOS) ; /bin/ln -s $(LIBSO) $(LIBSOS) ) cp ncftp.h ncftp_errno.h $(PREFIX)/include -chmod a+r $(PREFIX)/lib/$(LIBSO) $(PREFIX)/include/ncftp.h $(PREFIX)/include/ncftp_errno.h install: $(LIB) [ -d "$(PREFIX)/lib" ] || mkdir -m 755 "$(PREFIX)/lib" [ -d "$(PREFIX)/include" ] || mkdir -m 755 "$(PREFIX)/include" cp $(LIB) $(PREFIX)/lib/$(LIB) cp ncftp.h ncftp_errno.h $(PREFIX)/include -chmod a+r $(LIB) $(PREFIX)/lib/$(LIB) $(PREFIX)/include/ncftp.h $(PREFIX)/include/ncftp_errno.h ( cd ../sio ; $(MAKE) "PREFIX=$(PREFIX)" install ) ( cd ../Strn ; $(MAKE) "PREFIX=$(PREFIX)" install ) install_samples: ( cd ./samples ; $(MAKE) install ) .c.o: $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c .c.so: $(CC) -fpic $(CFLAGS) $(CPPFLAGS) $(DEFS) $*.c -c -o $*.so test: test.c $(OBJS) $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) test.c $(OBJS) -o test $(LDFLAGS) $(LIBS) ### Archiving ################################################################# TARDIR=libncftp-$(VERSION) TMPDIR=/tmp STGZFILE=libncftp-$(VERSION)-src.tar.gz gz sgz: $(PACKAGE) ./mksrctar.sh $(TARDIR) $(STGZFILE) ### Cleaning supplies ######################################################## clean: -/bin/rm -f $(OBJS) $(SOBJS) core $(LIB) $(LIBSO) $(LIBSOS) -[ -d ./samples/minincftp ] && cd ./samples/minincftp && $(MAKE) clean -[ -d ./samples/monkey ] && cd ./samples/monkey && $(MAKE) clean -[ -d ./samples/ncftpget ] && cd ./samples/ncftpget && $(MAKE) clean -[ -d ./samples/ncftpls ] && cd ./samples/ncftpls && $(MAKE) clean -[ -d ./samples/ncftpput ] && cd ./samples/ncftpput && $(MAKE) clean -[ -d ./samples/ncftpsyncput ] && cd ./samples/ncftpsyncput && $(MAKE) clean ( sleep 2 ; cd ../sio ; $(MAKE) clean ) ( sleep 2 ; cd ../Strn ; $(MAKE) clean ) ### Dependencies ############################################################# dep: gcc -MM $(CPPFLAGS) $(CFILES) open.o: open.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h open.so: open.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h cmds.o: cmds.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h cmds.so: cmds.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h util.o: util.c syshdrs.h ncftp.h ncftp_errno.h util.h util.so: util.c syshdrs.h ncftp.h ncftp_errno.h util.h rcmd.o: rcmd.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h rcmd.so: rcmd.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h ftp.o: ftp.c syshdrs.h ncftp.h ncftp_errno.h ftp.h util.h ftp.so: ftp.c syshdrs.h ncftp.h ncftp_errno.h ftp.h util.h io.o: io.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h io.so: io.c syshdrs.h ncftp.h ncftp_errno.h util.h ftp.h errno.o: errno.c syshdrs.h ncftp.h ncftp_errno.h errno.so: errno.c syshdrs.h ncftp.h ncftp_errno.h linelist.o: linelist.c syshdrs.h ncftp.h ncftp_errno.h util.h linelist.so: linelist.c syshdrs.h ncftp.h ncftp_errno.h util.h glob.o: glob.c syshdrs.h ncftp.h ncftp_errno.h util.h glob.so: glob.c syshdrs.h ncftp.h ncftp_errno.h util.h