Makefile
changeset 7 9334c8280602
parent 2 19bf8e678c42
equal deleted inserted replaced
6:fe4088d5573a 7:9334c8280602
     4 all:  libmb.a libmb.so
     4 all:  libmb.a libmb.so
     5 
     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
     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 
     7 
     8 libmb.a:  $(OBJ_FILES)
     8 libmb.a:  $(OBJ_FILES)
     9 	ar cr libmb.a $(OBJ_FILES)
     9 	$(AR) cr libmb.a $(OBJ_FILES)
    10 
    10 
    11 libmb.so: $(OBJ_FILES)
    11 libmb.so: $(OBJ_FILES)
    12 	gcc -shared -fPIC -o libmb.so $(OBJ_FILES)
    12 	$(CC) -shared -fPIC -o libmb.so $(OBJ_FILES)
    13 
    13 
    14 clean:
    14 clean:
    15 	-rm -rf *.o libmb.a libmb.so
    15 	-rm -rf *.o libmb.a libmb.so
    16 
    16 
    17 
    17 
    18 
    18 
    19 # use gcc
    19 # use gcc
    20 CC = gcc
    20 # CC = gcc
    21 
    21 
    22 #get warnings, debugging information and optimization
    22 #get warnings, debugging information and optimization
    23 CFLAGS  = -Wall -Wpointer-arith -Wstrict-prototypes -Wwrite-strings
    23 # CFLAGS  = -Wall -Wpointer-arith -Wstrict-prototypes -Wwrite-strings
    24 # CFLAGS += -Werror
    24 # CFLAGS += -Werror
    25 CFLAGS += -ggdb -O3 -funroll-loops
    25 # CFLAGS += -ggdb -O3 -funroll-loops
    26 # Note: if the optimizer crashes, we'll leave out the -O3 for those files
    26 # Note: if the optimizer crashes, we'll leave out the -O3 for those files
    27 
    27 
    28 # Required for compilation with beremiz, and to create shared object library
    28 # Required for compilation with beremiz, and to create shared object library
    29 CFLAGS += -fPIC
    29 CFLAGS += -fPIC
    30 
    30