1 #---------------------------------------------------------------- |
|
2 # |
|
3 # M a k e f i l e |
|
4 # |
|
5 # $Id$ |
|
6 # |
|
7 #---------------------------------------------------------------- |
|
8 |
|
9 LIBNET_DIR = ../../soft/libnet-install |
|
10 LIBPCAP_DIR = ../../soft/libpcap-install |
|
11 FLTK_DIR = ../../soft/fltk-2.0-install |
|
12 |
|
13 CC = g++ |
|
14 CFLAGS = -Wall -g -I$(LIBNET_DIR)/include -I$(LIBPCAP_DIR)/include \ |
|
15 `$(FLTK_DIR)/bin/fltk-config --cflags` |
|
16 |
|
17 TEST_EXE = ethercat-test |
|
18 TEST_OBJ = main.o ec_master.o ec_command.o ec_slave.o |
|
19 TEST_LDFLAGS = -L$(LIBNET_DIR)/lib -lnet -lpcap -lpthread |
|
20 |
|
21 GUI_EXE = ethercat-gui |
|
22 GUI_OBJ = main_gui.o ec_master.o ec_command.o ec_slave.o |
|
23 GUI_LDFLAGS = -L$(LIBNET_DIR)/lib -lnet -lpcap -lpthread `$(FLTK_DIR)/bin/fltk-config --ldflags` |
|
24 |
|
25 #---------------------------------------------------------------- |
|
26 |
|
27 first: $(TEST_EXE) $(GUI_EXE) |
|
28 |
|
29 $(TEST_EXE): $(TEST_OBJ) |
|
30 $(CC) $(TEST_OBJ) $(TEST_LDFLAGS) -o $@ |
|
31 |
|
32 $(GUI_EXE): $(GUI_OBJ) |
|
33 $(CC) $(GUI_OBJ) $(GUI_LDFLAGS) -o $@ |
|
34 |
|
35 .c.o: |
|
36 $(CC) $(CFLAGS) -c $< -o $@ |
|
37 |
|
38 .cpp.o: |
|
39 $(CC) $(CFLAGS) -c $< -o $@ |
|
40 |
|
41 #---------------------------------------------------------------- |
|
42 |
|
43 main.o: main.c \ |
|
44 ec_globals.h ec_master.h ec_command.h ec_slave.h |
|
45 |
|
46 main_gui.o: main_gui.cpp \ |
|
47 ec_globals.h ec_master.h ec_command.h ec_slave.h |
|
48 |
|
49 ec_command.o: ec_command.c ec_command.h |
|
50 |
|
51 ec_master.o: ec_master.c ec_master.h \ |
|
52 ec_globals.h ec_command.h ec_slave.h |
|
53 |
|
54 ec_slave.o: ec_slave.c ec_slave.h \ |
|
55 ec_globals.h |
|
56 |
|
57 #---------------------------------------------------------------- |
|
58 |
|
59 clean: |
|
60 rm -f *.o $(TEST_EXE) $(GUI_EXE) *~ |
|
61 |
|
62 #---------------------------------------------------------------- |
|
63 |
|