2015-06-18 12:46:46 +02:00
|
|
|
#
|
|
|
|
CC = gcc
|
|
|
|
SIZE = size
|
|
|
|
SHLIB = gcc -shared
|
|
|
|
STRIPLIB = strip --strip-unneeded
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
CFLAGS += -O3 -Wall
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
ALL = libpigpiod_if.so pigs
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
all: $(ALL) pigpio.py setup.py
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
pigpiod_if.o: pigpiod_if.c pigpio.h command.h pigpiod_if.h
|
|
|
|
$(CC) $(CFLAGS) -fpic -c -o pigpiod_if.o pigpiod_if.c
|
|
|
|
|
|
|
|
command.o: command.c pigpio.h command.h
|
|
|
|
$(CC) $(CFLAGS) -fpic -c -o command.o command.c
|
|
|
|
|
|
|
|
|
|
|
|
pigs: command.o pigs.o
|
|
|
|
$(CC) $(CFLAGS) -fpic -o pigs pigs.c command.c
|
2014-01-12 22:31:59 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o *.i *.s *~ $(ALL)
|
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
install: $(LIB)
|
2014-01-12 22:31:59 +01:00
|
|
|
sudo install -m 0755 -d /usr/local/include
|
|
|
|
sudo install -m 0644 pigpio.h /usr/local/include
|
|
|
|
sudo install -m 0644 pigpiod_if.h /usr/local/include
|
|
|
|
sudo install -m 0755 -d /usr/local/lib
|
2015-06-18 12:46:46 +02:00
|
|
|
sudo install -m 0644 libpigpiod_if.so /usr/local/lib
|
2014-01-12 22:31:59 +01:00
|
|
|
sudo install -m 0755 -d /usr/local/bin
|
|
|
|
sudo install -m 0755 pigs /usr/local/bin
|
2014-09-03 20:52:48 +02:00
|
|
|
sudo python2 setup.py install
|
|
|
|
sudo python3 setup.py install
|
2014-08-01 10:30:25 +02:00
|
|
|
sudo install -m 0755 -d /usr/local/man/man1
|
|
|
|
sudo install -m 0644 *.1 /usr/local/man/man1
|
|
|
|
sudo install -m 0755 -d /usr/local/man/man3
|
|
|
|
sudo install -m 0644 *.3 /usr/local/man/man3
|
2014-01-12 22:31:59 +01:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
sudo rm -f /usr/local/include/pigpio.h
|
2015-06-18 12:46:46 +02:00
|
|
|
sudo rm -f /usr/local/lib/libpigpiod_if.so
|
2014-01-12 22:31:59 +01:00
|
|
|
sudo rm -f /usr/local/bin/pigs
|
2014-08-01 10:30:25 +02:00
|
|
|
sudo rm -f /usr/local/man/man1/pig*.1
|
|
|
|
sudo rm -f /usr/local/man/man3/pig*.3
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
LIB = libpigpiod_if.so
|
|
|
|
OBJ = pigpiod_if.o command.o
|
2014-01-12 22:31:59 +01:00
|
|
|
|
2015-06-18 12:46:46 +02:00
|
|
|
$(LIB): $(OBJ)
|
|
|
|
$(SHLIB) -o $(LIB) $(OBJ)
|
|
|
|
$(STRIPLIB) $(LIB)
|
2014-01-12 22:31:59 +01:00
|
|
|
$(SIZE) $(LIB)
|
|
|
|
|
|
|
|
# generated using gcc -MM *.c
|
|
|
|
|
|
|
|
command.o: command.c pigpio.h command.h
|
2014-01-21 20:04:59 +01:00
|
|
|
pigpiod.o: pigpiod.c pigpio.h
|
|
|
|
pigpiod_if.o: pigpiod_if.c pigpio.h pigpiod_if.h command.h
|
2014-01-12 22:31:59 +01:00
|
|
|
pigs.o: pigs.c pigpio.h command.h
|
|
|
|
|