# Makefile for systems with GNU tools CC = gcc INSTALL = install IFLAGS = -idirafter dummyinc #CFLAGS = -g CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ -Wall -W -Wshadow -Werror -Wformat-security \ -D_FORTIFY_SOURCE=2 \ #-pedantic -Wconversion LIBS = -lcap -ldl -lcrypt -lpam -lwrap -lnsl -lssl -lcrypto # | | + VSF_BUILD_SSL # | + VSF_BUILD_TCPWRAPPERS # + VSF_BUILD_PAM LINK = -Wl,-s LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) .c.o: $(CC) -c $*.c $(CFLAGS) $(IFLAGS) vsftpd: $(OBJS) $(CC) -o vsftpd $(LDFLAGS) $(OBJS) $(LINK) $(LIBS) install: if [ -x /usr/local/sbin ]; then \ $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ else \ $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi if [ -x /usr/local/man ]; then \ $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ elif [ -x /usr/share/man ]; then \ $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ else \ $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi if [ -x /etc/xinetd.d ]; then \ $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi clean: rm -f *.o *.swp vsftpd