Makefile 872 Bytes
Newer Older
1 2
CC = $(CROSS_COMPILE)gcc
CFLAGS += -Wall -g -D_GNU_SOURCE
3

4 5 6 7
BINDIR=usr/bin
INSTALL_PROGRAM=install -m 755 -p
DEL_FILE=rm -f

8
all: iio_event_monitor lsiio iio_generic_buffer
9 10 11 12 13

iio_event_monitor: iio_event_monitor.o iio_utils.o

lsiio: lsiio.o iio_utils.o

14
iio_generic_buffer: iio_generic_buffer.o iio_utils.o
15 16 17

%.o: %.c iio_utils.h

18 19 20 21
install:
	- mkdir -p $(INSTALL_ROOT)/$(BINDIR)
	- $(INSTALL_PROGRAM) "iio_event_monitor" "$(INSTALL_ROOT)/$(BINDIR)/iio_event_monitor"
	- $(INSTALL_PROGRAM) "lsiio" "$(INSTALL_ROOT)/$(BINDIR)/lsiio"
22
	- $(INSTALL_PROGRAM) "iio_generic_buffer" "$(INSTALL_ROOT)/$(BINDIR)/iio_generic_buffer"
23 24 25 26

uninstall:
	$(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/iio_event_monitor"
	$(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/lsiio"
27
	$(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/iio_generic_buffer"
28

29 30
.PHONY: clean
clean:
31
	rm -f *.o iio_event_monitor lsiio iio_generic_buffer