# Generated automatically from Makefile.in by configure.
VERSION=0.0.8pre17

# main target
all: betaftpd

# various defines
CC = arm-merlin-linux-uclibc-gcc
prefix = /usr/local

CFLAGS      = -g -O2
REAL_CFLAGS = $(CFLAGS) -DHAVE_CONFIG_H -I. -I. -DVERSION=\"$(VERSION)\"
LIBS        =  -lcrypt
OBJS        = disp.o ftpd.o cmds.o nonroot.o ascii.o dcache.o
ASSMS       = ${OBJS:.o=.s}
CPPS        = ${OBJS:.o=.i}

# Since we use VPATH, override .c.o rule
.c.o:	$*.c config.h
	$(CC) $(REAL_CFLAGS) -c ./$*.c
.c.s:	$*.c config.h
	$(CC) $(REAL_CFLAGS) -S ./$*.c

# deps
cmds.o:		./cmds.c ./ftpd.h ./cmds.h ./nonroot.h ./dcache.h config.h
ftpd.o:		./ftpd.c ./ftpd.h ./cmds.h ./dcache.h config.h
disp.o:		./disp.c ./ftpd.h config.h
nonroot.o:	./nonroot.c ./nonroot.h config.h
ascii.o:	./ascii.c ./ascii.h config.h
dcache.o:	./dcache.c ./dcache.h config.h

betaftpd: $(OBJS)
	$(CC) $(REAL_CFLAGS) $(LIBS) -o betaftpd $(OBJS)
assembly-files: $(ASSMS)
betaftpd-from-assembly-files: $(ASSMS)
	$(CC) $(LIBS) -o betaftpd -Wl,--sort-common $(ASSMS)

clean:
	rm -f $(OBJS) $(ASSMS) $(CPPS)
	rm -f core
	rm -f betaftpd

distclean: clean
	rm -f config.log config.cache config.status Makefile config.h

install: betaftpd
	install betaftpd $(prefix)/sbin/betaftpd

#
# NOTE: This is not intended for end users, and should be run from a
# configured BetaFTPD in the source directory only.
#
package:
#	strip-exec
	rm -rf betaftpd-$(VERSION)
	mkdir betaftpd-$(VERSION)
	mkdir betaftpd-$(VERSION)/doc
	mkdir betaftpd-$(VERSION)/debian
#	cp betaftpd betaftpd-$(VERSION)
	make distclean
	autoconf
	autoheader configure.in > config.h.in
	@echo "The user packaging this package didn't have cvs2cl.pl available," > ChangeLog
	@echo "or he/she was offline during packaging. No ChangeLog is available." >> ChangeLog
	-cvs2cl.pl -U users
	cp ChangeLog README Makefile.in acconfig.h cmds.c cmds.h betaftpd-$(VERSION)
	cp config.h.in configure configure.in disp.c ftpd.c betaftpd-$(VERSION)
	cp nonroot.c ascii.c ascii.h nonroot.h ftpd.h betaftpd-$(VERSION)
	cp dcache.c dcache.h strip-exec betaftpd.lsm betaftpd-$(VERSION)
	cp doc/CREDITS doc/CHANGES doc/CHANGES-0.0.8 doc/COPYING betaftpd-$(VERSION)/doc
	cp doc/KNOWN-BUGS doc/RFC-COMPLIANCE doc/README.nonroot betaftpd-$(VERSION)/doc
	cp doc/README.rights doc/README.platforms betaftpd-$(VERSION)/doc
	cp debian/README.debian debian/betaftpd.7 debian/changelog betaftpd-$(VERSION)/debian
	cp debian/control debian/copyright debian/dirs debian/files betaftpd-$(VERSION)/debian
	cp debian/init.d debian/rules debian/substvars debian/watch.ex betaftpd-$(VERSION)/debian
	tar cf - betaftpd-$(VERSION)/ | gzip -9vv > betaftpd-$(VERSION).tar.gz
	tar cf - betaftpd-$(VERSION)/ | bzip2 -3vv > betaftpd-$(VERSION).tar.bz2
