Makefile 2.51 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
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 \
Cedric Roux's avatar
Cedric Roux committed
10
     extract_input_subframe extract_output_subframe to_vcd extract multi
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

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)

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 30 31
extract: extract.o database.o event.o utils.o config.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

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

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

42 43 44
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
45
	$(CC) $(CFLAGS) -o ue $^ $(LIBS) $(XLIBS)
46

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

52 53
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
54
	$(CC) $(CFLAGS) -o to_vcd $^ $(LIBS)
55

56 57 58 59
macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
                  config.o
	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)

Cedric Roux's avatar
Cedric Roux committed
60 61 62
multi: multi.o utils.o database.o config.o
	$(CC) $(CFLAGS) -o multi $^ $(LIBS)

Cedric Roux's avatar
Cedric Roux committed
63
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
Cedric Roux's avatar
Cedric Roux committed
64 65

gui/gui.a:
66
	cd gui && $(MAKE)
Cedric Roux's avatar
Cedric Roux committed
67 68

view/view.a:
69
	cd view && $(MAKE)
Cedric Roux's avatar
Cedric Roux committed
70 71

logger/logger.a:
72
	cd logger && $(MAKE)
Cedric Roux's avatar
Cedric Roux committed
73

Cedric Roux's avatar
Cedric Roux committed
74
filter/filter.a:
75
	cd filter && $(MAKE)
Cedric Roux's avatar
Cedric Roux committed
76

Cedric Roux's avatar
Cedric Roux committed
77 78
%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<
Cedric Roux's avatar
Cedric Roux committed
79 80

clean:
Cedric Roux's avatar
Cedric Roux committed
81
	rm -f *.o core tracer_remote textlog enb ue vcd record replay
82
	rm -f extract_config macpdu2wireshark extract_input_subframe
Cedric Roux's avatar
Cedric Roux committed
83
	rm -f extract_output_subframe to_vcd extract multi
84 85 86 87 88
	cd gui && $(MAKE) clean
	cd view && $(MAKE) clean
	cd logger && $(MAKE) clean
	cd filter && $(MAKE) clean
	cd hacks && $(MAKE) clean