pigpio/Makefile

92 lines
2.4 KiB
Makefile
Raw Normal View History

2015-02-02 22:11:28 +01:00
#
2013-12-12 11:27:22 +01:00
CC = gcc
AR = ar
RANLIB = ranlib
SIZE = size
CFLAGS += -O3 -Wall
2013-12-12 11:27:22 +01:00
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-03-13 16:50:23 +01:00
ALL = $(LIB) x_pigpio x_pigpiod_if pig2vcd pigpiod pigs
2013-12-12 11:27:22 +01:00
2014-03-13 16:50:23 +01:00
LL1 = -L. -lpigpio -lpthread -lrt
LL2 = -L. -lpigpiod_if -lpthread -lrt
2014-01-12 22:31:59 +01:00
all: $(ALL)
2013-12-12 11:27:22 +01:00
2014-03-13 16:50:23 +01:00
x_pigpio: x_pigpio.o $(LIB1)
$(CC) -o x_pigpio x_pigpio.c $(LL1)
x_pigpiod_if: x_pigpiod_if.o $(LIB2)
$(CC) -o x_pigpiod_if x_pigpiod_if.c $(LL2)
2013-12-12 11:27:22 +01:00
2014-01-12 22:31:59 +01:00
pigpiod: pigpiod.o $(LIB1)
2014-03-13 16:50:23 +01:00
$(CC) -o pigpiod pigpiod.c $(LL1)
2014-01-12 22:31:59 +01:00
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-03-13 16:50:23 +01:00
sudo install -m 0755 -d /opt/pigpio/cgi
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
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
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-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
2013-12-12 11:27:22 +01:00
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
command.o: command.c pigpio.h command.h
pig2vcd.o: pig2vcd.c pigpio.h
2015-02-02 22:11:28 +01:00
pigpio.o: pigpio.c pigpio.h command.h custom.cext
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
2015-02-02 22:11:28 +01:00
x_pigpio.o: x_pigpio.c pigpio.h
x_pigpiod_if.o: x_pigpiod_if.c pigpiod_if.h pigpio.h