2015-10-24 20:03:30 +02:00
|
|
|
prefix := /usr/local
|
|
|
|
|
|
|
|
# Detect the Raspberry Pi by the existence of the bcm_host.h file
|
|
|
|
BCMLOC=/opt/vc/include/bcm_host.h
|
|
|
|
|
|
|
|
ifneq ("$(wildcard $(BCMLOC))","")
|
|
|
|
# The recommended compiler flags for the Raspberry Pi
|
|
|
|
CCFLAGS=-Ofast -mfpu=vfp -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s
|
|
|
|
endif
|
|
|
|
|
|
|
|
# define all programs
|
|
|
|
PROGRAMS = spark_counter_receiver
|
2015-11-08 17:00:17 +01:00
|
|
|
SOURCES = ${PROGRAMS:=.cpp}
|
2015-10-24 20:03:30 +02:00
|
|
|
|
|
|
|
all: ${PROGRAMS}
|
|
|
|
|
|
|
|
${PROGRAMS}: ${SOURCES}
|
2015-11-08 17:00:17 +01:00
|
|
|
g++ ${CCFLAGS} -Wall -I../ -lrf24-bcm -lcurl -o $@ $<
|
2015-10-24 20:03:30 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(PROGRAMS)
|
|
|
|
|
|
|
|
install: all
|
|
|
|
test -d $(prefix) || mkdir $(prefix)
|
|
|
|
test -d $(prefix)/bin || mkdir $(prefix)/bin
|
|
|
|
for prog in $(PROGRAMS); do \
|
|
|
|
install -m 0755 $$prog $(prefix)/bin; \
|
|
|
|
done
|
|
|
|
|
|
|
|
.PHONY: install
|