summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-05-05 14:27:39 -0400
committerJoey Hess <joeyh@joeyh.name>2017-05-05 14:30:46 -0400
commit2f5315b3c32fbd23ebce05da80712183dc259b7c (patch)
tree48de39738910859cb0eaaf15cbfe9529b44e4272 /Makefile
parent4a2a01a7eaa8945d063468d7d1c24f095a3ae2a4 (diff)
downloaddebug-me-2f5315b3c32fbd23ebce05da80712183dc259b7c.tar.gz
standalone tarball
Adapted the standalone tarball building code from git-annex.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile54
1 files changed, 38 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index ca07972..3244942 100644
--- a/Makefile
+++ b/Makefile
@@ -41,22 +41,44 @@ debug-me:
clean:
if [ "$(BUILDER)" != ./Setup ] && [ "$(BUILDER)" != cabal ]; then $(BUILDER) clean; fi
- rm -rf debug-me dist .stack-work Setup Setup.hi Setup.o
+ rm -rf dist .stack-work tmp
+ rm -f debig-me Build/LinuxMkLibs Setup
+ find . -name \*.o -exec rm {} \;
+ find . -name \*.hi -exec rm {} \;
install: install-files
useradd --system debug-me
- chmod 700 $(PREFIX)/var/log/debug-me
- chown debug-me:debug-me $(PREFIX)/var/log/debug-me
-
-install-files: debug-me
- install -d $(PREFIX)/var/log/debug-me
- install -d $(PREFIX)/usr/bin
- install -s -m 0755 debug-me $(PREFIX)/usr/bin/debug-me
- install -d $(PREFIX)/usr/share/man/man1
- install -m 0644 debug-me.1 $(PREFIX)/usr/share/man/man1/debug-me.1
- install -d $(PREFIX)/lib/systemd/system
- install -m 0644 debug-me.service $(PREFIX)/lib/systemd/system/debug-me.service
- install -d $(PREFIX)/etc/init.d
- install -m 0755 debug-me.init $(PREFIX)/etc/init.d/debug-me
- install -d $(PREFIX)/etc/default
- install -m 0644 debug-me.default $(PREFIX)/etc/default/debug-me
+ chmod 700 $(DESTDIR)$(PREFIX)/var/log/debug-me
+ chown debug-me:debug-me $(DESTDIR)$(PREFIX)/var/log/debug-me
+
+install-files: debug-me install-mans
+ install -d $(DESTDIR)$(PREFIX)/var/log/debug-me
+ install -d $(DESTDIR)$(PREFIX)/usr/bin
+ install -s -m 0755 debug-me $(DESTDIR)$(PREFIX)/usr/bin/debug-me
+ install -d $(DESTDIR)$(PREFIX)/lib/systemd/system
+ install -m 0644 debug-me.service $(DESTDIR)$(PREFIX)/lib/systemd/system/debug-me.service
+ install -d $(DESTDIR)$(PREFIX)/etc/init.d
+ install -m 0755 debug-me.init $(DESTDIR)$(PREFIX)/etc/init.d/debug-me
+ install -d $(DESTDIR)$(PREFIX)/etc/default
+ install -m 0644 debug-me.default $(DESTDIR)$(PREFIX)/etc/default/debug-me
+
+install-mans:
+ install -d $(DESTDIR)$(PREFIX)/usr/share/man/man1
+ install -m 0644 debug-me.1 $(DESTDIR)$(PREFIX)/usr/share/man/man1/debug-me.1
+
+Build/LinuxMkLibs: Build/LinuxMkLibs.hs
+ ghc --make $@ -Wall -fno-warn-tabs
+
+LINUXSTANDALONE_DEST=tmp/debug-me
+linuxstandalone: debug-me Build/LinuxMkLibs
+ rm -rf "$(LINUXSTANDALONE_DEST)"
+ mkdir -p tmp
+ cp -R standalone/linux/skel "$(LINUXSTANDALONE_DEST)"
+ install -d "$(LINUXSTANDALONE_DEST)/bin"
+ cp debug-me "$(LINUXSTANDALONE_DEST)/bin/"
+ strip "$(LINUXSTANDALONE_DEST)/bin/debug-me"
+ ./Build/LinuxMkLibs "$(LINUXSTANDALONE_DEST)"
+ $(MAKE) install-mans DESTDIR="$(LINUXSTANDALONE_DEST)"
+ cd tmp && tar c debug-me | gzip -9 --rsyncable > debug-me-standalone-$(shell dpkg --print-architecture).tar.gz
+
+.PHONY: debug-me