Linus Walleij | 5462868 | 2015-05-05 10:42:12 +0200 | [diff] [blame] | 1 | CC = $(CROSS_COMPILE)gcc |
| 2 | CFLAGS += -Wall -g -D_GNU_SOURCE |
Roberta Dobrescu | 817020c | 2015-02-26 10:49:25 +0200 | [diff] [blame] | 3 | |
Peter Robinson | 0c4b650 | 2016-05-25 14:31:13 +0100 | [diff] [blame] | 4 | BINDIR=usr/bin |
| 5 | INSTALL_PROGRAM=install -m 755 -p |
| 6 | DEL_FILE=rm -f |
| 7 | |
Daniel Baluta | 5d48d6b | 2016-05-24 18:03:55 +0300 | [diff] [blame] | 8 | all: iio_event_monitor lsiio iio_generic_buffer |
Roberta Dobrescu | 817020c | 2015-02-26 10:49:25 +0200 | [diff] [blame] | 9 | |
| 10 | iio_event_monitor: iio_event_monitor.o iio_utils.o |
| 11 | |
| 12 | lsiio: lsiio.o iio_utils.o |
| 13 | |
Daniel Baluta | 5d48d6b | 2016-05-24 18:03:55 +0300 | [diff] [blame] | 14 | iio_generic_buffer: iio_generic_buffer.o iio_utils.o |
Roberta Dobrescu | 817020c | 2015-02-26 10:49:25 +0200 | [diff] [blame] | 15 | |
| 16 | %.o: %.c iio_utils.h |
| 17 | |
Peter Robinson | 0c4b650 | 2016-05-25 14:31:13 +0100 | [diff] [blame] | 18 | install: |
| 19 | - mkdir -p $(INSTALL_ROOT)/$(BINDIR) |
| 20 | - $(INSTALL_PROGRAM) "iio_event_monitor" "$(INSTALL_ROOT)/$(BINDIR)/iio_event_monitor" |
| 21 | - $(INSTALL_PROGRAM) "lsiio" "$(INSTALL_ROOT)/$(BINDIR)/lsiio" |
Daniel Baluta | 5d48d6b | 2016-05-24 18:03:55 +0300 | [diff] [blame] | 22 | - $(INSTALL_PROGRAM) "iio_generic_buffer" "$(INSTALL_ROOT)/$(BINDIR)/iio_generic_buffer" |
Peter Robinson | 0c4b650 | 2016-05-25 14:31:13 +0100 | [diff] [blame] | 23 | |
| 24 | uninstall: |
| 25 | $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/iio_event_monitor" |
| 26 | $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/lsiio" |
Daniel Baluta | 5d48d6b | 2016-05-24 18:03:55 +0300 | [diff] [blame] | 27 | $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/iio_generic_buffer" |
Peter Robinson | 0c4b650 | 2016-05-25 14:31:13 +0100 | [diff] [blame] | 28 | |
Roberta Dobrescu | 817020c | 2015-02-26 10:49:25 +0200 | [diff] [blame] | 29 | .PHONY: clean |
| 30 | clean: |
Daniel Baluta | 5d48d6b | 2016-05-24 18:03:55 +0300 | [diff] [blame] | 31 | rm -f *.o iio_event_monitor lsiio iio_generic_buffer |