Commit 0f928c04 authored by mz-fuzzy's avatar mz-fuzzy

pthread switch added to compile phase

interrupt module added to SPIDEV
changed to Ofast optimization
littlewire example fix
Signed-off-by: default avatarmz-fuzzy <mzfuzzy800@gmail.com>
parent ef1914b4
......@@ -23,7 +23,7 @@ OBJECTS+=spi.o gpio.o compatibility.o
else ifeq ($(DRIVER), RPi)
OBJECTS+=spi.o bcm2835.o interrupt.o
else ifeq ($(DRIVER), SPIDEV)
OBJECTS+=spi.o gpio.o compatibility.o
OBJECTS+=spi.o gpio.o compatibility.o interrupt.o
endif
# make all
......@@ -37,22 +37,22 @@ $(LIBNAME): $(OBJECTS)
# Library parts
RF24.o: RF24.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $^
$(CXX) -fPIC $(CFLAGS) -c $^
bcm2835.o: $(DRIVER_DIR)/bcm2835.c
$(CC) -Wall -fPIC $(CFLAGS) -c $^
$(CC) -fPIC $(CFLAGS) -c $^
spi.o: $(DRIVER_DIR)/spi.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $^
$(CXX) -fPIC $(CFLAGS) -c $^
compatibility.o: $(DRIVER_DIR)/compatibility.c
$(CC) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/compatibility.c
$(CC) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/compatibility.c
gpio.o: $(DRIVER_DIR)/gpio.cpp
$(CXX) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/gpio.cpp
$(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/gpio.cpp
interrupt.o: $(DRIVER_DIR)/interrupt.c
$(CXX) -Wall -fPIC $(CFLAGS) -c $(DRIVER_DIR)/interrupt.c
$(CXX) -fPIC $(CFLAGS) -c $(DRIVER_DIR)/interrupt.c
# clear configuration files
cleanconfig:
......
......@@ -366,6 +366,7 @@ fi
case ${DRIVER} in
SPIDEV)
SHARED_LINKER_FLAGS+=" -pthread"
;;
RPi)
SHARED_LINKER_FLAGS+=" -pthread"
......@@ -414,7 +415,7 @@ if [ "${LIB_DEPRECATE_NAME}" ]; then
fi
fi
DRIVER_DIR=${DRIVER_DIR:-${ARCH_DIR}/${DRIVER}}
CFLAGS="$CPUFLAGS -O2 -Wall -g $CFLAGS"
CFLAGS="$CPUFLAGS -Ofast -Wall -pthread $CFLAGS"
echo "[SECTION] Preparing configuration."
cp ${DRIVER_DIR}/includes.h ${ARCH_DIR}/includes.h
......
......@@ -14,10 +14,15 @@
BINARY_PREFIX = rf24
SOURCES = $(PROGRAMS:=.cpp)
LIBS=-l$(LIB)
ifeq ($(DRIVER), LittleWire)
LIBS+= -llittlewire-spi
endif
all: $(PROGRAMS)
$(PROGRAMS): $(SOURCES)
$(CXX) $(CFLAGS) -I$(HEADER_DIR)/.. -I.. -L$(LIB_DIR) -l$(LIB) $@.cpp -o $@
$(CXX) $(CFLAGS) -I$(HEADER_DIR)/.. -I.. -L$(LIB_DIR) $(LIBS) $@.cpp -o $@
clean:
@echo "[Cleaning]"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment