summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-04-28 21:59:17 +0200
committerjaseg <code@jaseg.net>2016-04-28 22:05:39 +0200
commit64e25bef9c8e797f2c1af2f73b8faa6c46456fef (patch)
tree43be04654af061099d2e9e30ea2905851dc44a8e
parentdd685e3d8b35973be28a03cfa0c20cd2b35b5cbd (diff)
downloadlolcat-64e25bef9c8e797f2c1af2f73b8faa6c46456fef.tar.gz
lolcat-64e25bef9c8e797f2c1af2f73b8faa6c46456fef.tar.bz2
lolcat-64e25bef9c8e797f2c1af2f73b8faa6c46456fef.zip
Add dynamic compilation option
-rw-r--r--Makefile26
-rwxr-xr-xcensorbin26088 -> 0 bytes
-rwxr-xr-xlolcatbin40840 -> 0 bytes
3 files changed, 17 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 0acbb89..f6aba9a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,35 @@
all: lolcat censor
+.PHONY: install clean musl static
+
musl/lib/libc.a musl/lib/crt1.o:
cd musl; ./configure
make -C musl
musl: musl/lib/libc.a musl/lib/crt1.o
-lolcat: lolcat.c musl
- 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
+static: lolcat-static censor-static
+
+lolcat-static: lolcat.c musl
+ gcc -c -std=c11 -Wall -Imusl/include -o lolcat.o $<
+ gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o $@ lolcat.o musl/lib/crt1.o musl/lib/libc.a
+
+censor-static: censor.c musl
+ gcc -c -std=c11 -Wall -Imusl/include -o censor.o $<
+ gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o $@ censor.o musl/lib/crt1.o musl/lib/libc.a
-censor: censor.c musl
- gcc -c -std=c11 -Wall -Imusl/include -o censor.o censor.c
- gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o censor censor.o musl/lib/crt1.o musl/lib/libc.a
+lolcat: lolcat.c
+ gcc -std=c11 -Wall -o $@ $<
+
+censor: censor.c
+ gcc -std=c11 -Wall -o $@ $<
install: lolcat censor
install lolcat /usr/local/bin
install censor /usr/local/bin
clean:
- rm -f lolcat lolcat.o censor censor.o
+ rm -f lolcat lolcat-static.o lolcat-static censor censor-static.o censor-static
make -C musl clean
-.PHONY: install clean musl
-
diff --git a/censor b/censor
deleted file mode 100755
index 94b83f7..0000000
--- a/censor
+++ /dev/null
Binary files differ
diff --git a/lolcat b/lolcat
deleted file mode 100755
index 83fdf9a..0000000
--- a/lolcat
+++ /dev/null
Binary files differ