mirror of https://github.com/joan2937/pigpio
69 lines
1.8 KiB
Plaintext
69 lines
1.8 KiB
Plaintext
#
|
|
CC = gcc
|
|
SIZE = size
|
|
SHLIB = gcc -shared
|
|
STRIPLIB = strip --strip-unneeded
|
|
|
|
CFLAGS += -O3 -Wall
|
|
|
|
ALL = libpigpiod_if.so pigs
|
|
|
|
all: $(ALL) pigpio.py setup.py
|
|
|
|
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
|
|
|
|
clean:
|
|
rm -f *.o *.i *.s *~ $(ALL)
|
|
|
|
install: $(LIB)
|
|
install -m 0755 -d /usr/local/include
|
|
install -m 0644 pigpio.h /usr/local/include
|
|
install -m 0644 pigpiod_if.h /usr/local/include
|
|
install -m 0755 -d /usr/local/lib
|
|
install -m 0644 libpigpiod_if.so /usr/local/lib
|
|
install -m 0755 -d /usr/local/bin
|
|
install -m 0755 pigs /usr/local/bin
|
|
python2 setup.py install
|
|
python3 setup.py install
|
|
install -m 0755 -d /usr/local/man/man1
|
|
install -m 0644 *.1 /usr/local/man/man1
|
|
install -m 0755 -d /usr/local/man/man3
|
|
install -m 0644 *.3 /usr/local/man/man3
|
|
|
|
uninstall:
|
|
rm -f /usr/local/include/pigpio.h
|
|
rm -f /usr/local/lib/libpigpiod_if.so
|
|
echo removing python2 files
|
|
python2 setup.py install --record /tmp/pigpio >/dev/null
|
|
xargs rm -f < /tmp/pigpio >/dev/null
|
|
echo removing python3 files
|
|
python3 setup.py install --record /tmp/pigpio >/dev/null
|
|
xargs rm -f < /tmp/pigpio >/dev/null
|
|
rm -f /usr/local/bin/pigs
|
|
rm -f /usr/local/man/man1/pig*.1
|
|
rm -f /usr/local/man/man3/pig*.3
|
|
|
|
LIB = libpigpiod_if.so
|
|
OBJ = pigpiod_if.o command.o
|
|
|
|
$(LIB): $(OBJ)
|
|
$(SHLIB) -o $(LIB) $(OBJ)
|
|
$(STRIPLIB) $(LIB)
|
|
$(SIZE) $(LIB)
|
|
|
|
# generated using gcc -MM *.c
|
|
|
|
command.o: command.c pigpio.h command.h
|
|
pigpiod.o: pigpiod.c pigpio.h
|
|
pigpiod_if.o: pigpiod_if.c pigpio.h pigpiod_if.h command.h
|
|
pigs.o: pigs.c pigpio.h command.h
|
|
|