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