Day 1
This commit is contained in:
18
Makefile
Normal file
18
Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
STDLIB_HEADERS := $(wildcard stdlib/include/*)
|
||||
STDLIB_SOURCES := $(wildcard stdlib/src/*)
|
||||
|
||||
TARGETS := $(patsubst src/%.c,bin/%,$(wildcard src/*.c))
|
||||
|
||||
CFLAGS := -O2 -nostdlib -Istdlib/include -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin -std=c99 -pedantic -Wall -Werror -fno-stack-protector -static -Wl,-n
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
bin/%: src/%.c $(STDLIB_SOURCES) $(STDLIB_HEADERS)
|
||||
@mkdir -p $(@D)
|
||||
gcc $(CFLAGS) $< $(STDLIB_SOURCES) -o $@
|
||||
strip -R .comment $@
|
||||
|
||||
clean:
|
||||
rm -rf bin
|
Reference in New Issue
Block a user