pigpio/Makefile

79 lines
1.9 KiB
Makefile
Raw Normal View History

2013-12-12 11:27:22 +01:00
CC = gcc
AR = ar
RANLIB = ranlib
SIZE = size
CFLAGS = -O3 -Wall
2014-01-12 22:31:59 +01:00
LIB1 = libpigpio.a
OBJ1 = pigpio.o command.o
2013-12-12 11:32:49 +01:00
2014-01-12 22:31:59 +01:00
LIB2 = libpigpiod_if.a
OBJ2 = pigpiod_if.o command.o
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
LIB = $(LIB1) $(LIB2)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
ALL = $(LIB) checklib pig2vcd pigpiod pigs
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
LL = -L. -lpigpio -lpthread -lrt
all: $(ALL)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
checklib: checklib.o $(LIB1)
$(CC) -o checklib checklib.c $(LL)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
pigpiod: pigpiod.o $(LIB1)
$(CC) -o pigpiod pigpiod.c $(LL)
pigs: pigs.o command.o
2013-12-12 11:27:22 +01:00
$(CC) -o pigs pigs.c command.c
2014-01-12 22:31:59 +01:00
pig2vcd: pig2vcd.o
$(CC) -o pig2vcd pig2vcd.c
2013-12-12 11:27:22 +01:00
clean:
2013-12-12 11:32:49 +01:00
rm -f *.o *.i *.s *~ $(ALL)
2013-12-12 11:27:22 +01: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
sudo install -m 0644 libpigpio.a /usr/local/lib
sudo install -m 0644 libpigpiod_if.a /usr/local/lib
sudo install -m 0755 -d /usr/local/bin
sudo install -m 0755 pig2vcd /usr/local/bin
sudo install -m 0755 pigpiod /usr/local/bin
sudo install -m 0755 pigs /usr/local/bin
2013-12-12 11:32:49 +01:00
sudo python setup.py install
2013-12-12 11:27:22 +01:00
uninstall:
2013-12-12 11:32:49 +01:00
sudo rm -f /usr/local/include/pigpio.h
2014-01-12 22:31:59 +01:00
sudo rm -f /usr/local/include/pigpiod_if.h
2013-12-12 11:32:49 +01:00
sudo rm -f /usr/local/lib/libpigpio.a
2014-01-12 22:31:59 +01:00
sudo rm -f /usr/local/lib/libpigpiod_if.a
2013-12-12 11:27:22 +01:00
sudo rm -f /usr/local/bin/pig2vcd
sudo rm -f /usr/local/bin/pigpiod
sudo rm -f /usr/local/bin/pigs
2014-01-12 22:31:59 +01:00
$(LIB1): $(OBJ1)
$(AR) rcs $(LIB1) $(OBJ1)
$(RANLIB) $(LIB1)
$(SIZE) $(LIB1)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
$(LIB2): $(OBJ2)
$(AR) rcs $(LIB2) $(OBJ2)
$(RANLIB) $(LIB2)
$(SIZE) $(LIB2)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
# generated using gcc -MM *.c
2013-12-12 11:27:22 +01:00
2013-12-12 11:32:49 +01:00
checklib.o: checklib.c pigpio.h
command.o: command.c pigpio.h command.h
pig2vcd.o: pig2vcd.c pigpio.h
pigpio.o: pigpio.c pigpio.h command.h
2014-01-21 20:04:59 +01:00
pigpiod.o: pigpiod.c pigpio.h
2014-01-12 22:31:59 +01:00
pigpiod_if.o: pigpiod_if.c pigpio.h command.h pigpiod_if.h
2013-12-12 11:32:49 +01:00
pigs.o: pigs.c pigpio.h command.h
2013-12-12 11:27:22 +01:00