Skip to contentSkip to conversation

rtc-tools: Add a Makefile

PATCH Superseded Fabio Estevam 1 participant 1 message Jan 23, 2022

Subsystems (2)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc-tools: Add a Makefile

From: Fabio Estevam <[email protected]>

Add a Makefile to make installation and uninstallation process easier.

---
 Makefile | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 Makefile
Makefile new file +29 -0
new file mode 100644
index 000000000000..4f244d9289f1
@@ -0,0 +1,29 @@
+prefix ?= /usr
+bindir ?= $(prefix)/bin
+
+EXEC = rtc-range rtc rtc-sync
+
+all: $(EXEC)
+
+rtc-range: rtc-range.c
+	$(CC) $(CFLAGS) -o $@ rtc-range.c
+
+rtc: rtc.c
+	$(CC) $(CFLAGS) -o $@ rtc.c
+
+rtc-sync: rtc-sync.c
+	$(CC) $(CFLAGS) -o $@ rtc-sync.c
+
+clean:
+	rm -f $(EXEC)
+
+install: rtc-range rtc rtc-sync
+	mkdir -p '$(DESTDIR)$(bindir)'
+	install -m755 rtc-range '$(DESTDIR)$(bindir)/rtc-range'
+	install -m755 rtc '$(DESTDIR)$(bindir)/rtc'
+	install -m755 rtc-sync '$(DESTDIR)$(bindir)/rtc-sync'
+
+uninstall:
+	rm -rf '$(DESTDIR)$(bindir)/rtc-range'
+	rm -rf '$(DESTDIR)$(bindir)/rtc'
+	rm -rf '$(DESTDIR)$(bindir)/rtc-sync'
Signature · 1 line
2.25.1