summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2015-07-07 02:49:51 +0200
committerjaseg <code@jaseg.net>2015-07-07 02:49:51 +0200
commit84dc917720ff12a741bf87824bef1e6c31c9e1f2 (patch)
tree0dd61b098bc8192dfcc7399db686926ff5a56442 /Makefile
parent5bd8c7dccaf04939fc8aa8b9a9aecdb56f2b9b91 (diff)
downloadlolcat-84dc917720ff12a741bf87824bef1e6c31c9e1f2.tar.gz
lolcat-84dc917720ff12a741bf87824bef1e6c31c9e1f2.tar.bz2
lolcat-84dc917720ff12a741bf87824bef1e6c31c9e1f2.zip
Link statically against musl
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ff1d72d..b6ef5fe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,19 @@
all: lolcat
-lolcat: lolcat.c fgetwc_fix.c
- gcc -g -std=c99 -Wall -o lolcat lolcat.c fgetwc_fix.c
+musl/lib/libc.a musl/lib/crt1.o:
+ cd musl; ./configure
+ make -C musl
+
+lolcat: lolcat.c musl/lib/libc.a musl/lib/crt1.o
+ gcc -c -std=c11 -Wall -Imusl/include -o lolcat.o lolcat.c
+ gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o lolcat lolcat.o musl/lib/crt1.o musl/lib/libc.a
install: lolcat
install lolcat /usr/local/bin
-.PHONY: install all
+clean:
+ rm -f lolcat lolcat.o
+
+.PHONY: install clean