Makefile 2.29 KB
Newer Older
Cedric Roux's avatar
Cedric Roux committed
1 2
CC=gcc
CFLAGS=-Wall -g -pthread -DT_TRACER -I.
3

Cedric Roux's avatar
Cedric Roux committed
4
#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
Cedric Roux's avatar
Cedric Roux committed
5

Cedric Roux's avatar
Cedric Roux committed
6 7
LIBS=-lm
XLIBS=-lX11 -lpng -lXft
Cedric Roux's avatar
Cedric Roux committed
8

9
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
10
     extract_input_subframe extract_output_subframe to_vcd
Cedric Roux's avatar
Cedric Roux committed
11 12 13

record: utils.o record.o database.o config.o
	$(CC) $(CFLAGS) -o record $^ $(LIBS)
Cedric Roux's avatar
Cedric Roux committed
14

Cedric Roux's avatar
Cedric Roux committed
15 16 17
replay: utils.o replay.o
	$(CC) $(CFLAGS) -o replay $^ $(LIBS)

18 19 20
extract_config: extract_config.o
	$(CC) $(CFLAGS) -o extract_config $^ $(LIBS)

21 22 23 24
extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \
    config.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

Cedric Roux's avatar
Cedric Roux committed
25 26 27 28
extract_output_subframe: extract_output_subframe.o database.o event.o utils.o \
    config.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

Cedric Roux's avatar
Cedric Roux committed
29
textlog: utils.o textlog.o database.o event.o handler.o config.o \
Cedric Roux's avatar
Cedric Roux committed
30 31
         event_selector.o view/view.a gui/gui.a logger/logger.a \
         filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
32
	$(CC) $(CFLAGS) -o textlog $^ $(LIBS) $(XLIBS)
Cedric Roux's avatar
Cedric Roux committed
33 34

enb: utils.o enb.o database.o event.o handler.o config.o \
Cedric Roux's avatar
Cedric Roux committed
35 36
         event_selector.o view/view.a gui/gui.a logger/logger.a \
         filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
37
	$(CC) $(CFLAGS) -o enb $^ $(LIBS) $(XLIBS)
Cedric Roux's avatar
Cedric Roux committed
38

39 40 41
ue: utils.o ue.o database.o event.o handler.o config.o \
         event_selector.o view/view.a gui/gui.a logger/logger.a \
         filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
42
	$(CC) $(CFLAGS) -o ue $^ $(LIBS) $(XLIBS)
43

Cedric Roux's avatar
Cedric Roux committed
44
vcd: utils.o vcd.o database.o event.o handler.o config.o \
Cedric Roux's avatar
Cedric Roux committed
45 46
         event_selector.o view/view.a gui/gui.a logger/logger.a \
         filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
47
	$(CC) $(CFLAGS) -o vcd $^ $(LIBS) $(XLIBS)
Cedric Roux's avatar
Cedric Roux committed
48

49 50
to_vcd: to_vcd.o database.o event.o handler.o utils.o config.o \
         logger/logger.a filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
51
	$(CC) $(CFLAGS) -o to_vcd $^ $(LIBS)
52

53 54 55 56
macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
                  config.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

Cedric Roux's avatar
Cedric Roux committed
57
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
58 59 60 61 62 63 64 65 66 67

gui/gui.a:
	cd gui && make

view/view.a:
	cd view && make

logger/logger.a:
	cd logger && make

Cedric Roux's avatar
Cedric Roux committed
68 69 70
filter/filter.a:
	cd filter && make

Cedric Roux's avatar
Cedric Roux committed
71 72
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<
Cedric Roux's avatar
Cedric Roux committed
73 74

clean:
Cedric Roux's avatar
Cedric Roux committed
75
	rm -f *.o core tracer_remote textlog enb ue vcd record replay
76
	rm -f extract_config macpdu2wireshark extract_input_subframe
77
	rm -f extract_output_subframe to_vcd
Cedric Roux's avatar
Cedric Roux committed
78 79 80
	cd gui && make clean
	cd view && make clean
	cd logger && make clean
Cedric Roux's avatar
Cedric Roux committed
81
	cd filter && make clean
82
	cd hacks && make clean