# Don't edit Makefile! Use conf-* for configuration.
SHELL=/bin/sh
all: ncp npush npoll
npush: ncp
ln -s ncp npush
npoll: ncp
ln -s ncp npoll
setup: install
PREFIX=/usr/local
#DIET=/opt/diet/bin/diet -Os
CC=cc
CFLAGS=-fno-common
LDFLAGS= -L/usr/local/lib
install:
install -d $(PREFIX)/bin $(PREFIX)/man/man1
install ncp $(PREFIX)/bin
ln -f $(PREFIX)/bin/ncp $(PREFIX)/bin/npush
ln -f $(PREFIX)/bin/ncp $(PREFIX)/bin/npoll
install -m 644 ncp.1 npush.1 $(PREFIX)/man/man1
uninstall:
rm -f $(PREFIX)/bin/ncp $(PREFIX)/bin/npush $(PREFIX)/bin/npoll $(PREFIX)/man/man1/ncp.1 $(PREFIX)/man/man1/npush.1
ncp: ncp.c libsocket
$(DIET) $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) -lowfat `cat libsocket`
strip ncp
clean:
rm -f *.o ncp core *~ *.bak npush npoll libsocket
libsocket: trysocket.c
if $(DIET) $(CC) $(CFLAGS) -o trysocket trysocket.c >/dev/null 2>&1; then echo ""; else \
if $(DIET) $(CC) $(CFLAGS) -o trysocket trysocket.c -lsocket >/dev/null 2>&1; then echo "-lsocket"; else \
if $(DIET) $(CC) $(CFLAGS) -o trysocket trysocket.c -lsocket -lnsl >/dev/null 2>&1; then echo "-lsocket -lnsl"; \
fi; fi; fi > libsocket
rm -f trysocket
syntax highlighted by Code2HTML, v. 0.9.1