mirror of
https://github.com/yarrick/iodine.git
synced 2024-12-26 17:47:50 +00:00
37 lines
809 B
Makefile
37 lines
809 B
Makefile
CC = gcc
|
|
COMMONOBJS = tun.o dns.o read.o encoding.o login.o base32.o base64.o md5.o common.o
|
|
CLIENTOBJS = iodine.o
|
|
CLIENT = ../bin/iodine
|
|
SERVEROBJS = iodined.o user.o fw_query.o
|
|
SERVER = ../bin/iodined
|
|
|
|
OS = `uname | tr "a-z" "A-Z"`
|
|
ARCH = `uname -m`
|
|
|
|
LDFLAGS = -lz `sh osflags link`
|
|
CFLAGS = -c -g -Wall -D$(OS) -pedantic `sh osflags cflags`
|
|
|
|
all: stateos $(CLIENT) $(SERVER)
|
|
|
|
stateos:
|
|
@echo OS is $(OS), arch is $(ARCH)
|
|
|
|
$(CLIENT): $(COMMONOBJS) $(CLIENTOBJS)
|
|
@echo LD $@
|
|
@mkdir -p ../bin
|
|
@$(CC) $(COMMONOBJS) $(CLIENTOBJS) -o $(CLIENT) $(LDFLAGS)
|
|
|
|
$(SERVER): $(COMMONOBJS) $(SERVEROBJS)
|
|
@echo LD $@
|
|
@mkdir -p ../bin
|
|
@$(CC) $(COMMONOBJS) $(SERVEROBJS) -o $(SERVER) $(LDFLAGS)
|
|
|
|
.c.o:
|
|
@echo CC $<
|
|
@$(CC) $(CFLAGS) $< -o $@
|
|
|
|
clean:
|
|
@echo "Cleaning src/"
|
|
@rm -f $(CLIENT) $(SERVER) *~ *.o *.core
|
|
|