summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 10 insertions, 28 deletions
diff --git a/Makefile b/Makefile
index 1cd5cc8..1be84e5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,43 +1,25 @@
+CC ?= gcc
LOLCAT_SRC ?= lolcat.c
CENSOR_SRC ?= censor.c
-CFLAGS ?= -std=c11 -Wall -g
+CFLAGS ?= -std=c11 -Wall -Wextra -g
DESTDIR ?= /usr/local/bin
-all: lolcat-static censor-static
+all: lolcat censor
-include Makefile.musl
-
-ifeq ($(shell uname -s),Darwin)
- LOLCAT_SRC += memorymapping/src/fmemopen.c
- CENSOR_SRC += memorymapping/src/fmemopen.c
- CFLAGS += -Imemorymapping/src
-endif
-
-.PHONY: install clean static
-
-static: lolcat-static censor-static
-
-lolcat-static: lolcat.c
- gcc -c $(CFLAGS) -I$(MUSLDIR)/include -o lolcat.o $<
- gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o $@ lolcat.o $(MUSLDIR)/lib/crt1.o $(MUSLDIR)/lib/libc.a
-
-censor-static: censor.c
- gcc -c $(CFLAGS) -I$(MUSLDIR)/include -o censor.o $<
- gcc -s -nostartfiles -nodefaultlibs -nostdinc -static -ffunction-sections -fdata-sections -Wl,--gc-sections -o $@ censor.o $(MUSLDIR)/lib/crt1.o $(MUSLDIR)/lib/libc.a
+.PHONY: install clean
lolcat: $(LOLCAT_SRC)
- gcc $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^
censor: $(CENSOR_SRC)
- gcc $(CFLAGS) -o $@ $^
+ $(CC) $(CFLAGS) -o $@ $^
-install: lolcat-static censor-static
- install lolcat-static $(DESTDIR)/lolcat
- install censor-static $(DESTDIR)/censor
+install: lolcat censor
+ install lolcat $(DESTDIR)/lolcat
+ install censor $(DESTDIR)/censor
clean:
- rm -f lolcat lolcat-static.o lolcat-static censor censor-static.o censor-static
- # make -C musl clean
+ rm -f lolcat censor