# Copyright (c) Nickolay G. Grygoryev 1996
# Top-level makefile

include CONFIG

LDFLAGS = -s
LIBS = 
CC = gcc
CFLAGS = -DLINUX -pipe -m486 -g ${DEFINES} ${DFNAMES}

SRCS = fidotools.c felib.c convert.c fetoss.c attach.c crc32.c\
       postfile.c
HDRS = fidotools.h felib.h convert.h fetoss.h attach.h crc32.h\
       postfile.h
OBJFE = fidotools.o felib.o convert.o fetoss.o attach.o crc32.o\
	postfile.o

all:	fidotools

clean:
	rm -f *.o core a.out fidotools

fidotools:	${OBJFE}
	${CC} ${LDFLAGS} ${OBJFE} ${LIBS} ${DEFINES} -o fidotools

install:
	install -g ${GROUP} -o ${USER} -m 6555 fidotools ${DEST}/fidotools
	ln -s ${DEST}/fidotools ${DEST}/${FETOSS}
	chown ${USER}.${GROUP} ${DEST}/${FETOSS}
	ln -s ${DEST}/fidotools ${DEST}/${ATTACH}
	chown ${USER}.${GROUP} ${DEST}/${ATTACH}
	ln -s ${DEST}/fidotools ${DEST}/${POSTFILE}
	chown ${USER}.${GROUP} ${DEST}/${POSTFILE}

install-configs:
	mkdir ${CONFIGDIR}
	chown ${USER}.${GROUP} ${CONFIGDIR}
	chmod 755 ${CONFIGDIR}
	install -g ${GROUP} -o ${USER} -m 644 config/Config ${CONFIG}
	install -g ${GROUP} -o ${USER} -m 644 config/FAreas ${FAREAS}
	install -g ${GROUP} -o ${USER} -m 644 config/Receivers ${RECEIVERS}
	install -g ${GROUP} -o ${USER} -m 644 config/Senders ${SENDERS}
	install -g ${GROUP} -o ${USER} -m 644 config/Neighbours ${NEIGHBOURS}

uninstall:
	rm ${DEST}/fidotools
	rm ${DEST}/${FETOSS}
	rm ${DEST}/${ATTACH}
	rm ${DEST}/${POSTFILE}

uninstall-configs:
#	rm -r ${CONFIGDIR}

###

