2006-06-05 12:41:08 +00:00
|
|
|
CC = gcc
|
2008-07-12 11:36:39 +00:00
|
|
|
COMMONOBJS = tun.o dns.o read.o encoding.o login.o base32.o base64.o md5.o common.o
|
2007-06-09 17:48:28 +00:00
|
|
|
CLIENTOBJS = iodine.o
|
2006-11-09 19:08:28 +00:00
|
|
|
CLIENT = ../bin/iodine
|
2008-08-07 21:18:15 +00:00
|
|
|
SERVEROBJS = iodined.o user.o fw_query.o
|
2006-11-09 19:08:28 +00:00
|
|
|
SERVER = ../bin/iodined
|
2006-06-05 12:41:08 +00:00
|
|
|
|
2006-06-05 12:58:50 +00:00
|
|
|
OS = `uname | tr "a-z" "A-Z"`
|
2007-01-28 04:17:33 +00:00
|
|
|
ARCH = `uname -m`
|
2006-06-05 12:58:50 +00:00
|
|
|
|
2009-01-24 22:19:11 +00:00
|
|
|
LIBPATH = -L.
|
|
|
|
LDFLAGS = -lz `sh osflags link` $(LIBPATH)
|
2008-08-07 16:53:59 +00:00
|
|
|
CFLAGS = -c -g -Wall -D$(OS) -pedantic `sh osflags cflags`
|
2006-06-05 12:58:50 +00:00
|
|
|
|
2007-12-01 21:23:59 +00:00
|
|
|
all: stateos $(CLIENT) $(SERVER)
|
2006-08-24 21:02:52 +00:00
|
|
|
|
2006-06-05 12:58:50 +00:00
|
|
|
stateos:
|
2007-01-28 04:17:33 +00:00
|
|
|
@echo OS is $(OS), arch is $(ARCH)
|
2006-06-05 12:41:08 +00:00
|
|
|
|
2007-06-09 17:48:28 +00:00
|
|
|
$(CLIENT): $(COMMONOBJS) $(CLIENTOBJS)
|
2006-06-05 13:44:15 +00:00
|
|
|
@echo LD $@
|
2006-11-09 19:08:28 +00:00
|
|
|
@mkdir -p ../bin
|
2007-06-09 17:48:28 +00:00
|
|
|
@$(CC) $(COMMONOBJS) $(CLIENTOBJS) -o $(CLIENT) $(LDFLAGS)
|
2006-06-05 18:47:09 +00:00
|
|
|
|
2007-06-09 17:48:28 +00:00
|
|
|
$(SERVER): $(COMMONOBJS) $(SERVEROBJS)
|
2006-06-05 18:47:09 +00:00
|
|
|
@echo LD $@
|
2006-11-09 19:08:28 +00:00
|
|
|
@mkdir -p ../bin
|
2007-06-09 17:48:28 +00:00
|
|
|
@$(CC) $(COMMONOBJS) $(SERVEROBJS) -o $(SERVER) $(LDFLAGS)
|
2006-06-05 12:41:08 +00:00
|
|
|
|
2006-06-05 13:16:24 +00:00
|
|
|
.c.o:
|
2006-06-05 13:45:20 +00:00
|
|
|
@echo CC $<
|
2006-06-05 13:16:24 +00:00
|
|
|
@$(CC) $(CFLAGS) $< -o $@
|
2006-06-05 12:41:08 +00:00
|
|
|
|
|
|
|
clean:
|
2006-11-18 13:37:37 +00:00
|
|
|
@echo "Cleaning src/"
|
2009-01-24 22:19:11 +00:00
|
|
|
@rm -f $(CLIENT){,.exe} $(SERVER){,.exe} *~ *.o *.core
|
2006-06-05 12:41:08 +00:00
|
|
|
|