From 84dc917720ff12a741bf87824bef1e6c31c9e1f2 Mon Sep 17 00:00:00 2001 From: jaseg Date: Tue, 7 Jul 2015 02:49:51 +0200 Subject: Link statically against musl --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Makefile') 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 -- cgit