msousa@0: msousa@0: default: all msousa@0: msousa@0: all: libmb.a libmb.so msousa@0: msousa@0: 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 msousa@0: msousa@0: libmb.a: $(OBJ_FILES) Edouard@2: $(AR) cr libmb.a $(OBJ_FILES) msousa@0: msousa@0: libmb.so: $(OBJ_FILES) Edouard@2: $(CC) -shared -fPIC -o libmb.so $(OBJ_FILES) msousa@0: msousa@0: clean: msousa@0: -rm -rf *.o libmb.a libmb.so msousa@0: msousa@0: msousa@0: msousa@0: # use gcc Edouard@2: # CC = gcc msousa@0: msousa@0: #get warnings, debugging information and optimization Edouard@2: # CFLAGS = -Wall -Wpointer-arith -Wstrict-prototypes -Wwrite-strings msousa@0: # CFLAGS += -Werror Edouard@2: # CFLAGS += -ggdb -O3 -funroll-loops msousa@0: # Note: if the optimizer crashes, we'll leave out the -O3 for those files msousa@0: msousa@0: # Required for compilation with beremiz, and to create shared object library msousa@0: CFLAGS += -fPIC msousa@0: msousa@0: msousa@0: msousa@0: #how to make things from other directories if they are missing msousa@0: ../% /%: msousa@0: $(MAKE) -C $(@D) $(@F) msousa@0: msousa@0: Makefile.depend depend: msousa@0: # gcc -MM -MG -I$(LLIB) *.c \ msousa@0: gcc -MM -MG *.c \ msousa@0: | perl -pe 's/:/ Makefile.depend:/' \ msousa@0: > Makefile.depend msousa@0: msousa@0: include Makefile.depend msousa@0: