29 lines
763 B
Makefile
29 lines
763 B
Makefile
CFLAGS=-fPIC -Icontrib/SOEM/soem -Icontrib/SOEM/osal -Icontrib/SOEM/osal/linux -Icontrib/SOEM/oshw/linux
|
|
|
|
SRC_ECMBIND=$(wildcard libecmbind/*.c)
|
|
OBJ_ECMBIND=$(SRC_ECMBIND:libecmbind/%.c=.build/ecmbind/%.o)
|
|
|
|
|
|
all: DIR libecmbind.so
|
|
|
|
clean:
|
|
rm -Rf .build/soem .build/ecmbind .build/soem-unpack
|
|
|
|
DIR:
|
|
mkdir -p .build/ecmbind .build/soem .build/soem-unpack
|
|
|
|
.build/soem/libsoem.a: contrib/SOEM/CMakeLists.txt
|
|
rm -Rf .build/soem/*
|
|
cd .build/soem; CFLAGS=-fPIC cmake ../../contrib/SOEM; make
|
|
cd .build/soem-unpack; ar x ../soem/libsoem.a
|
|
|
|
libecmbind.so: $(OBJ_ECMBIND) .build/soem/libsoem.a
|
|
gcc -shared -o ln.ethercat/lib/libecmbind.so $(OBJ_ECMBIND) $(wildcard .build/soem-unpack/*.o) -lpthread
|
|
|
|
|
|
|
|
|
|
|
|
.build/ecmbind/%.o: libecmbind/%.c
|
|
gcc -c -o $@ $< $(CFLAGS)
|