Skip to contentSkip to conversation

tools/gpio: remove old Makefile

PATCH Superseded Andy Shevchenko 1 participant 3 messages Jun 17, 2016

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tools/gpio: remove old Makefile

Prepare to switch to tools build system, i.e. remove Makefile completely. There is no much sense to keep it since it will be rewritten (almost) completely.

---
 tools/gpio/Makefile | 14 --------------
 1 file changed, 14 deletions(-)
 delete mode 100644 tools/gpio/Makefile
tools/gpio/Makefile deleted +0 -14
deleted file mode 100644
index 619314f..0000000
@@ -1,14 +0,0 @@
-CC = $(CROSS_COMPILE)gcc
-CFLAGS += -O2 -Wall -g -D_GNU_SOURCE
-
-all: lsgpio gpio-hammer gpio-event-mon
-
-lsgpio: lsgpio.o gpio-utils.o
-gpio-hammer: gpio-hammer.o gpio-utils.o
-gpio-event-mon: gpio-event-mon.o gpio-utils.o
-
-%.o: %.c gpio-utils.h
-
-.PHONY: clean
-clean:
-	rm -f *.o lsgpio gpio-hammer gpio-event-mon
Signature · 1 line
2.8.1
#1 lore raw

PATCH 2/3 tools/gpio: move to tools buildsystem

There is a nice buildsystem dedicated for userspace tools in Linux kernel tree. Switch gpio target to be built by it.

---
 tools/gpio/Build    |  3 +++
 tools/gpio/Makefile | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+)
 create mode 100644 tools/gpio/Build
 create mode 100644 tools/gpio/Makefile
tools/gpio/Build new file +3 -0
new file mode 100644
index 0000000..620c1937
@@ -0,0 +1,3 @@
+lsgpio-y += lsgpio.o gpio-utils.o
+gpio-hammer-y += gpio-hammer.o gpio-utils.o
+gpio-event-mon-y += gpio-event-mon.o gpio-utils.o
tools/gpio/Makefile new file +77 -0

77 lines not on this page · raw message

Signature · 1 line
2.8.1
#2 lore raw

PATCH 3/3 tools/gpio: add install section

In reply to Andy Shevchenko

Allow user to call install target.

---
 tools/Makefile      | 7 ++++---
 tools/gpio/Makefile | 8 +++++++-
 2 files changed, 11 insertions(+), 4 deletions(-)
tools/Makefile +4 -3
index f10b64d8..daa8fb3 100644
@@ -85,7 +85,7 @@ tmon: FORCE
 freefall: FORCE
 	$(call descend,laptop/$@)
 
-all: acpi cgroup cpupower hv firewire lguest \
+all: acpi cgroup cpupower gpio hv firewire lguest \
 		perf selftests turbostat usb \
 		virtio vm net x86_energy_perf_policy \
 		tmon freefall objtool
@@ -96,7 +96,7 @@ acpi_install:
 cpupower_install:
 	$(call descend,power/$(@:_install=),install)
 
-cgroup_install firewire_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install objtool_install:
+cgroup_install firewire_install gpio_install hv_install lguest_install perf_install usb_install virtio_install vm_install net_install objtool_install:
 	$(call descend,$(@:_install=),install)
 
 selftests_install:
@@ -114,7 +114,8 @@ freefall_install:
 kvm_stat_install:
 	$(call descend,kvm/$(@:_install=),install)
 
-install: acpi_install cgroup_install cpupower_install hv_install firewire_install lguest_install \
+install: acpi_install cgroup_install cpupower_install gpio_install \
+		hv_install firewire_install lguest_install \
 		perf_install selftests_install turbostat_install usb_install \
 		virtio_install vm_install net_install x86_energy_perf_policy_install \
 		tmon_install freefall_install objtool_install kvm_stat_install
tools/gpio/Makefile +7 -1
index 5ea607c..74d739c 100644
@@ -72,6 +72,12 @@ clean:
 	$(Q)rm -f $(OUTPUT)include/linux/gpio.h
 	$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.d' -delete
 
+install: $(ALL_PROGRAMS)
+	$(Q)install -d -m 755 $(DESTDIR)$(bindir);		\
+	$(Q)for program in $(ALL_PROGRAMS); do			\
+		$(Q)install $$program $(DESTDIR)$(bindir);	\
+	done
+
 FORCE:
 
-.PHONY: all clean FORCE prepare
+.PHONY: all install clean FORCE prepare
Signature · 1 line
2.8.1