2009-12-29 22:00:57 +02:00
|
|
|
COMMONOBJS = tun.o dns.o read.o encoding.o login.o base32.o base64.o base64u.o base128.o md5.o common.o
|
2009-08-16 15:30:26 +03:00
|
|
|
CLIENTOBJS = iodine.o client.o util.o
|
2006-11-09 21:08:28 +02:00
|
|
|
CLIENT = ../bin/iodine
|
2008-08-08 00:18:15 +03:00
|
|
|
SERVEROBJS = iodined.o user.o fw_query.o
|
2006-11-09 21:08:28 +02:00
|
|
|
SERVER = ../bin/iodined
|
2006-06-05 15:41:08 +03:00
|
|
|
|
2009-01-25 18:28:17 +02:00
|
|
|
OS = `echo $(TARGETOS) | tr "a-z" "A-Z"`
|
2007-01-28 06:17:33 +02:00
|
|
|
ARCH = `uname -m`
|
2006-06-05 15:58:50 +03:00
|
|
|
|
2009-01-25 00:19:11 +02:00
|
|
|
LIBPATH = -L.
|
2009-08-15 22:17:02 +03:00
|
|
|
LDFLAGS += -lz `sh osflags $(TARGETOS) link` $(LIBPATH)
|
|
|
|
CFLAGS += -c -g -Wall -D$(OS) -pedantic `sh osflags $(TARGETOS) cflags`
|
2006-06-05 15:58:50 +03:00
|
|
|
|
2007-12-01 23:23:59 +02:00
|
|
|
all: stateos $(CLIENT) $(SERVER)
|
2006-08-25 00:02:52 +03:00
|
|
|
|
2006-06-05 15:58:50 +03:00
|
|
|
stateos:
|
2007-01-28 06:17:33 +02:00
|
|
|
@echo OS is $(OS), arch is $(ARCH)
|
2006-06-05 15:41:08 +03:00
|
|
|
|
2007-06-09 20:48:28 +03:00
|
|
|
$(CLIENT): $(COMMONOBJS) $(CLIENTOBJS)
|
2006-06-05 16:44:15 +03:00
|
|
|
@echo LD $@
|
2006-11-09 21:08:28 +02:00
|
|
|
@mkdir -p ../bin
|
2007-06-09 20:48:28 +03:00
|
|
|
@$(CC) $(COMMONOBJS) $(CLIENTOBJS) -o $(CLIENT) $(LDFLAGS)
|
2006-06-05 21:47:09 +03:00
|
|
|
|
2007-06-09 20:48:28 +03:00
|
|
|
$(SERVER): $(COMMONOBJS) $(SERVEROBJS)
|
2006-06-05 21:47:09 +03:00
|
|
|
@echo LD $@
|
2006-11-09 21:08:28 +02:00
|
|
|
@mkdir -p ../bin
|
2007-06-09 20:48:28 +03:00
|
|
|
@$(CC) $(COMMONOBJS) $(SERVEROBJS) -o $(SERVER) $(LDFLAGS)
|
2006-06-05 15:41:08 +03:00
|
|
|
|
2006-06-05 16:16:24 +03:00
|
|
|
.c.o:
|
2006-06-05 16:45:20 +03:00
|
|
|
@echo CC $<
|
2006-06-05 16:16:24 +03:00
|
|
|
@$(CC) $(CFLAGS) $< -o $@
|
2006-06-05 15:41:08 +03:00
|
|
|
|
2009-12-29 22:00:57 +02:00
|
|
|
base64u.o client.o iodined.o: base64u.h
|
|
|
|
base64u.c: base64.c
|
|
|
|
@echo Making $@
|
|
|
|
@echo '/* No use in editing, produced by Makefile! */' > $@
|
|
|
|
@sed -e 's/\(base64\)/\1u/ig ; s/0123456789+/0123456789_/' < $< >> $@
|
|
|
|
base64u.h: base64.h
|
|
|
|
@echo Making $@
|
|
|
|
@echo '/* No use in editing, produced by Makefile! */' > $@
|
|
|
|
@sed -e 's/\(base64\)/\1u/ig ; s/0123456789+/0123456789_/' < $< >> $@
|
|
|
|
|
2006-06-05 15:41:08 +03:00
|
|
|
clean:
|
2006-11-18 15:37:37 +02:00
|
|
|
@echo "Cleaning src/"
|
2009-12-29 22:00:57 +02:00
|
|
|
@rm -f $(CLIENT){,.exe} $(SERVER){,.exe} *~ *.o *.core base64u.*
|
2006-06-05 15:41:08 +03:00
|
|
|
|