Makefile
author Lluís Batlle <viric@viric.name>
Thu, 20 Mar 2014 16:29:13 +0100
branchsaveflie
changeset 96 d090ddac5131
parent 93 7d9b7a6da507
permissions -rw-r--r--
Fixing the build on linux, gcc linking parameters order

CC=gcc
CFLAGS=-g -Wall -O0
INSTALL=install -c
ifeq ($(shell uname),Linux)
LINUX_OBJECTS=eth_linux.o \
	eth_proto.o \
	eth_server.o \
	eth_client.o
LINUX_LIBS=-lutil
endif
OBJECTS=main.o unix_client.o unix_server.o error.o signals.o gen_sockets.o \
	app_control.o \
	client.o \
	server.o \
	app_term.o \
	client_term.o \
	user_term.o \
	tcp_server.o \
	simple_math.o \
	xterm.o \
	dump.o \
	flow.o \
	filter.o \
	filter_string.o \
	filter_tildes.o \
	filter_telnet.o $(LINUX_OBJECTS)

all: tm

install: tm
	$(INSTALL) -d $(PREFIX)/bin
	$(INSTALL) tm $(PREFIX)/bin

tm: $(OBJECTS)
	$(CC) -o $@ $^ $(LINUX_LIBS)

test_filter: test_filter.o filter.o simple_math.o filter_string.o error.o

clean:
	rm -f $(OBJECTS) stdinmix

main.o: main.c main.h handlers.h
unix_server.o: unix_server.c main.h handlers.h
unix_client.o: unix_client.c main.h handlers.h
error.o: error.c main.h
signals.o: signals.c main.h handlers.h
gen_sockets.o: gen_sockets.c main.h
app_control.o: app_control.c main.h handlers.h
client.o: client.c main.h handlers.h
server.o: server.c main.h handlers.h
app_term.o: app_term.c main.h
client_term.o: client_term.c main.h
user_term.o: user_term.c main.h
tcp_server.o: tcp_server.c main.h handlers.h
simple_math.o: simple_math.c main.h
filter.o: filter.c filter.h main.h
test_filter.o: test_filter.c filter.h
filter_string.o: filter_string.c filter.h
filter_telnet.o: filter_telnet.c filter.h
xterm.o: xterm.c main.h
dump.o: dump.c main.h
eth_linux.o: eth_linux.c eth_linux.h
eth_proto.o: eth_proto.c main.h eth_linux.h
eth_server.o: eth_server.c main.h handlers.h
eth_client.o: eth_client.c main.h handlers.h
flow.o: flow.c main.h handlers.h