0
|
1 |
|
|
2 |
default: all
|
|
3 |
|
|
4 |
all: libmb.a libmb.so
|
|
5 |
|
|
6 |
OBJ_FILES = mb_ascii.o mb_rtu.o mb_tcp.o mb_master.o mb_slave.o mb_slave_and_master.o sin_util.o
|
|
7 |
|
|
8 |
libmb.a: $(OBJ_FILES)
|
|
9 |
ar cr libmb.a $(OBJ_FILES)
|
|
10 |
|
|
11 |
libmb.so: $(OBJ_FILES)
|
|
12 |
gcc -shared -fPIC -o libmb.so $(OBJ_FILES)
|
|
13 |
|
|
14 |
clean:
|
|
15 |
-rm -rf *.o libmb.a libmb.so
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
# use gcc
|
|
20 |
CC = gcc
|
|
21 |
|
|
22 |
#get warnings, debugging information and optimization
|
|
23 |
CFLAGS = -Wall -Wpointer-arith -Wstrict-prototypes -Wwrite-strings
|
|
24 |
# CFLAGS += -Werror
|
|
25 |
CFLAGS += -ggdb -O3 -funroll-loops
|
|
26 |
# Note: if the optimizer crashes, we'll leave out the -O3 for those files
|
|
27 |
|
|
28 |
# Required for compilation with beremiz, and to create shared object library
|
|
29 |
CFLAGS += -fPIC
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
#how to make things from other directories if they are missing
|
|
34 |
../% /%:
|
|
35 |
$(MAKE) -C $(@D) $(@F)
|
|
36 |
|
|
37 |
Makefile.depend depend:
|
|
38 |
# gcc -MM -MG -I$(LLIB) *.c \
|
|
39 |
gcc -MM -MG *.c \
|
|
40 |
| perl -pe 's/:/ Makefile.depend:/' \
|
|
41 |
> Makefile.depend
|
|
42 |
|
|
43 |
include Makefile.depend
|
|
44 |
|