summaryrefslogtreecommitdiff
path: root/Makefile.musl
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-11-18 10:22:53 +0100
committerjaseg <git@jaseg.net>2016-11-18 10:31:10 +0100
commitce0ee8d53807fdf1028812ffef96a8d481d0e078 (patch)
treef879064f2e84495216e52187827304cd9504584e /Makefile.musl
parentf585abdc4f9f7562422d2b606d4b1b1993b4e5ac (diff)
downloadlolcat-ce0ee8d53807fdf1028812ffef96a8d481d0e078.tar.gz
lolcat-ce0ee8d53807fdf1028812ffef96a8d481d0e078.tar.bz2
lolcat-ce0ee8d53807fdf1028812ffef96a8d481d0e078.zip
Fix musl build on various platforms
Diffstat (limited to 'Makefile.musl')
-rw-r--r--Makefile.musl27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile.musl b/Makefile.musl
new file mode 100644
index 0000000..1f19ea0
--- /dev/null
+++ b/Makefile.musl
@@ -0,0 +1,27 @@
+
+ifneq (,$(wildcard /usr/local/musl))
+MUSLDIR ?= /usr/local/musl
+else ifneq (,$(wildcard /usr/lib/musl))
+MUSLDIR ?= /usr/lib/musl
+else ifneq (,$(wildcard musl/Makefile))
+MUSLDIR ?= musl
+lolcat-static: musl
+censor-static: musl
+else
+$(info "musl not found. If the build does not go through, consider either installing")
+$(info "musl system-wide using your favorite package manager or fetching and building a")
+$(info "local copy using:")
+$(info "$ git submodule init")
+$(info "$ git submodule update")
+$(info "$ make musl")
+endif
+$(info "Using musl at $(MUSLDIR)")
+
+musl/lib/libc.a musl/lib/crt1.o: musl/config.mak
+ make -C musl
+
+musl/config.mak:
+ cd musl; ./configure
+
+musl: musl/lib/libc.a musl/lib/crt1.o
+