# user that isproxy will run as for install
INSTALLUSER=iip

# installation prefix for install
PREFIX=/usr/local

# location of binary for install
INSTALLEXEPATH=$(PREFIX)/bin/

# IIP configuration files storage location for install
# this is only created and files copied to it, changing this will not
# affect any of defaults in the executable
INSTALLFILEPATH=/home/iip/.iip/

# location of manpage for install
INSTALLMANDST=$(PREFIX)/man/man1/isproxy.1

# location of binary for install-local
INSTALLLOCALEXEPATH=$(HOME)/bin/
INSTALLLOCALFILEPATH=$(HOME)/.iip/

INSTALL=install

CC=cc
LD=cc
CFLAGS+=-g -I. -I..
LDFLAGS=-g
BASEOBJS=base/array.o base/bignum.o base/buffer.o base/cfg.o base/dblock.o base/itag.o base/logger.o base/mem.o base/parse.o base/ptrarray.o base/strarray.o base/str.o base/strio.o base/time.o base/getch.o
COREOBJS=msgcore/core.o msgcore/message.o msgcore/messageq.o
NETOBJS=net/noderef.o net/nodeserv.o net/protocfg.o net/protocol.o net/sock.o net/sockserv.o
UIOBJS=ui/ui.o ui/ui-dumb.o
CRYPTOBJS=crypt/arcfour.o crypt/blowfish.o crypt/crc.o crypt/dh.o crypt/xtea.o crypt/entropy.o crypt/sha1.o crypt/rand-key.o crypt/random.o crypt/salt.o
FILEOBJS=file/file.o
PIPEFACEOBJS=pipeface/pipeface.o pipeface/raw.o
PIPEOBJS=pipe/cs-iip1.o pipe/cs-iip11.o pipe/backward.o pipe/closdlay.o pipe/c-stream.o pipe/crypt.o pipe/dummy.o pipe/nodetran.o pipe/spurt.o pipe/steady.o pipe/pipe.o
MISCOBJS=misc/global.o misc/unix.o
IIPOBJS=iip/debug.o iip/iip.o iip/iip-ui.o

IIPALLOBJS=$(IIPOBJS) $(BASEOBJS) $(COREOBJS) $(NETOBJS) $(CRYPTOBJS) $(PIPEOBJS) $(PIPEFACEOBJS) $(UIOBJS) $(MISCOBJS) $(FILEOBJS)

SRCDOCS=base/*.c base/*.h msgcore/*.c msgcore/*.h crypt/*.c crypt/*.h file/*.c file/*.h iip/*.c iip/*.h misc/*.c misc/*.h net/*.c net/*.h pipe/*.c pipe/*.h pipeface/*.c pipeface/*.h ui/*.c ui/*.h
SRCDOCDIR=srcdoc/

IIPEXE=isproxy
IIPNODEREF=node.ref

INSTALLMANSRC=../doc/isproxy.1

all: $(IIPEXE)

clean:
	rm -f $(IIPALLOBJS)
	rm -f $(IIPEXE)

undos:
	dos2unix --keepdate base/*.c
	dos2unix --keepdate base/*.h
	dos2unix --keepdate msgcore/*.c
	dos2unix --keepdate msgcore/*.h
	dos2unix --keepdate crypt/*.c
	dos2unix --keepdate crypt/*.h
	dos2unix --keepdate file/*.c
	dos2unix --keepdate file/*.h
	dos2unix --keepdate iip/*.c
	dos2unix --keepdate iip/*.h
	dos2unix --keepdate misc/*.c
	dos2unix --keepdate misc/*.h
	dos2unix --keepdate net/*.c
	dos2unix --keepdate net/*.h
	dos2unix --keepdate pipe/*.c
	dos2unix --keepdate pipe/*.h
	dos2unix --keepdate pipeface/*.c
	dos2unix --keepdate pipeface/*.h
	dos2unix --keepdate ui/*.c
	dos2unix --keepdate ui/*.h

dev: clean $(IIPEXE)

$(IIPEXE): $(IIPALLOBJS)
	$(LD) $(LDFLAGS) $(IIPALLOBJS) -o $(IIPEXE)

srcdoc: $(SRCDOCS)
	doc++ -d $(SRCDOCDIR) -H $(SRCDOCS)

install: $(IIPEXE)
	$(INSTALL) -o $(INSTALLUSER) -m700 -d $(INSTALLFILEPATH)
	$(INSTALL) -o $(INSTALLUSER) -m4555 $(IIPEXE) $(INSTALLEXEPATH)$(IIPEXE)
	$(INSTALL) -o $(INSTALLUSER) -m644 $(IIPNODEREF) $(INSTALLFILEPATH)$(IIPNODEREF)
	$(INSTALL) -m444 $(INSTALLMANSRC) $(INSTALLMANDST)

install-local: $(IIPEXE)
	$(INSTALL) -m700 -d $(INSTALLLOCALFILEPATH) $(INSTALLLOCALEXEPATH)
	$(INSTALL) -m700 $(IIPEXE) $(INSTALLLOCALEXEPATH)$(IIPEXE)
	$(INSTALL) -m600 $(IIPNODEREF) $(INSTALLLOCALFILEPATH)$(IIPNODEREF)

base/array.o: base/array.c
	$(CC) -c $(CFLAGS) -o base/array.o base/array.c

base/bignum.o: base/bignum.c
	$(CC) -c $(CFLAGS) -o base/bignum.o base/bignum.c

base/buffer.o: base/buffer.c
	$(CC) -c $(CFLAGS) -o base/buffer.o base/buffer.c

base/cfg.o: base/cfg.c
	$(CC) -c $(CFLAGS) -o base/cfg.o base/cfg.c

base/dblock.o: base/dblock.c
	$(CC) -c $(CFLAGS) -o base/dblock.o base/dblock.c

base/itag.o: base/itag.c
	$(CC) -c $(CFLAGS) -o base/itag.o base/itag.c

base/logger.o: base/logger.c
	$(CC) -c $(CFLAGS) -o base/logger.o base/logger.c

base/mem.o: base/mem.c
	$(CC) -c $(CFLAGS) -o base/mem.o base/mem.c

base/parse.o: base/parse.c
	$(CC) -c $(CFLAGS) -o base/parse.o base/parse.c

base/ptrarray.o: base/ptrarray.c
	$(CC) -c $(CFLAGS) -o base/ptrarray.o base/ptrarray.c

base/strarray.o: base/strarray.c
	$(CC) -c $(CFLAGS) -o base/strarray.o base/strarray.c

base/str.o: base/str.c
	$(CC) -c $(CFLAGS) -o base/str.o base/str.c

base/strio.o: base/strio.c
	$(CC) -c $(CFLAGS) -o base/strio.o base/strio.c

base/time.o: base/time.c
	$(CC) -c $(CFLAGS) -o base/time.o base/time.c

base/getch.o: base/getch.c
	$(CC) -c $(CFLAGS) -o base/getch.o base/getch.c



msgcore/core.o: msgcore/core.c
	$(CC) -c $(CFLAGS) -o msgcore/core.o msgcore/core.c

msgcore/message.o: msgcore/message.c
	$(CC) -c $(CFLAGS) -o msgcore/message.o msgcore/message.c

msgcore/messageq.o: msgcore/messageq.c
	$(CC) -c $(CFLAGS) -o msgcore/messageq.o msgcore/messageq.c



net/noderef.o: net/noderef.c
	$(CC) -c $(CFLAGS) -o net/noderef.o net/noderef.c

net/nodeserv.o: net/nodeserv.c
	$(CC) -c $(CFLAGS) -o net/nodeserv.o net/nodeserv.c

net/protocfg.o: net/protocfg.c
	$(CC) -c $(CFLAGS) -o net/protocfg.o net/protocfg.c

net/protocol.o: net/protocol.c
	$(CC) -c $(CFLAGS) -o net/protocol.o net/protocol.c

net/sock.o: net/sock.c
	$(CC) -c $(CFLAGS) -o net/sock.o net/sock.c

net/sockserv.o: net/sockserv.c
	$(CC) -c $(CFLAGS) -o net/sockserv.o net/sockserv.c



ui/ui.o: ui/ui.c
	$(CC) -c $(CFLAGS) -o ui/ui.o ui/ui.c

ui/ui-dumb.o: ui/ui-dumb.c
	$(CC) -c $(CFLAGS) -o ui/ui-dumb.o ui/ui-dumb.c



crypt/arcfour.o: crypt/arcfour.c
	$(CC) -c $(CFLAGS) -o crypt/arcfour.o crypt/arcfour.c

crypt/blowfish.o: crypt/blowfish.c
	$(CC) -c $(CFLAGS) -o crypt/blowfish.o crypt/blowfish.c

crypt/crc.o: crypt/crc.c
	$(CC) -c $(CFLAGS) -o crypt/crc.o crypt/crc.c

crypt/dh.o: crypt/dh.c
	$(CC) -c $(CFLAGS) -o crypt/dh.o crypt/dh.c

crypt/xtea.o: crypt/xtea.c
	$(CC) -c $(CFLAGS) -o crypt/xtea.o crypt/xtea.c

crypt/entropy.o: crypt/entropy.c
	$(CC) -c $(CFLAGS) -o crypt/entropy.o crypt/entropy.c

crypt/sha1.o: crypt/sha1.c
	$(CC) -c $(CFLAGS) -o crypt/sha1.o crypt/sha1.c

crypt/rand-key.o: crypt/rand-key.c
	$(CC) -c $(CFLAGS) -o crypt/rand-key.o crypt/rand-key.c

crypt/random.o: crypt/random.c
	$(CC) -c $(CFLAGS) -o crypt/random.o crypt/random.c

crypt/salt.o: crypt/salt.c
	$(CC) -c $(CFLAGS) -o crypt/salt.o crypt/salt.c



file/file.o: file/file.c
	$(CC) -c $(CFLAGS) -o file/file.o file/file.c



pipeface/pipeface.o: pipeface/pipeface.c
	$(CC) -c $(CFLAGS) -o pipeface/pipeface.o pipeface/pipeface.c

pipeface/raw.o: pipeface/raw.c
	$(CC) -c $(CFLAGS) -o pipeface/raw.o pipeface/raw.c

pipe/cs-iip1.o: pipe/cs-iip1.c
	$(CC) -c $(CFLAGS) -o pipe/cs-iip1.o pipe/cs-iip1.c

pipe/cs-iip11.o: pipe/cs-iip11.c
	$(CC) -c $(CFLAGS) -o pipe/cs-iip11.o pipe/cs-iip11.c

pipe/backward.o: pipe/backward.c
	$(CC) -c $(CFLAGS) -o pipe/backward.o pipe/backward.c

pipe/closdlay.o: pipe/closdlay.c
	$(CC) -c $(CFLAGS) -o pipe/closdlay.o pipe/closdlay.c

pipe/crypt.o: pipe/crypt.c
	$(CC) -c $(CFLAGS) -o pipe/crypt.o pipe/crypt.c

pipe/c-stream.o: pipe/c-stream.c
	$(CC) -c $(CFLAGS) -o pipe/c-stream.o pipe/c-stream.c

pipe/dummy.o: pipe/dummy.c
	$(CC) -c $(CFLAGS) -o pipe/dummy.o pipe/dummy.c

pipe/nodetran.o: pipe/nodetran.c
	$(CC) -c $(CFLAGS) -o pipe/nodetran.o pipe/nodetran.c

pipe/spurt.o: pipe/spurt.c
	$(CC) -c $(CFLAGS) -o pipe/spurt.o pipe/spurt.c

pipe/steady.o: pipe/steady.c
	$(CC) -c $(CFLAGS) -o pipe/steady.o pipe/steady.c

pipe/pipe.o: pipe/pipe.c
	$(CC) -c $(CFLAGS) -o pipe/pipe.o pipe/pipe.c



misc/global.o: misc/global.c
	$(CC) -c $(CFLAGS) -o misc/global.o misc/global.c

misc/unix.o: misc/unix.c
	$(CC) -c $(CFLAGS) -o misc/unix.o misc/unix.c



iip/debug.o: iip/debug.c
	$(CC) -c $(CFLAGS) -o iip/debug.o iip/debug.c

iip/iip.o: iip/iip.c
	$(CC) -c $(CFLAGS) -o iip/iip.o iip/iip.c

iip/iip-ui.o: iip/iip-ui.c
	$(CC) -c $(CFLAGS) -o iip/iip-ui.o iip/iip-ui.c




syntax highlighted by Code2HTML, v. 0.9.1