37 lines
612 B
Makefile
37 lines
612 B
Makefile
|
########################
|
||
|
# (c) Ren Kararou 2023 #
|
||
|
# All rights reserved #
|
||
|
########################
|
||
|
|
||
|
# For use with GNU Make
|
||
|
|
||
|
CFLAGS ?= -Wall -Wextra -march=native -O3 -flto=thin -funroll-loops
|
||
|
|
||
|
.PHONY : all
|
||
|
all : bld/fizzbuzz
|
||
|
|
||
|
.PHONY : debug
|
||
|
debug : bld/fizzbuzz-dbg
|
||
|
|
||
|
obj/%.o : src/%.c
|
||
|
@mkdir -p obj
|
||
|
@cc $(CFLAGS) -c -o $@ $<
|
||
|
|
||
|
bld/fizzbuzz : obj/main.o
|
||
|
@mkdir -p bld
|
||
|
@cc $(CFLAGS) -o $@ $<
|
||
|
@llvm-strip $@
|
||
|
|
||
|
dbg/%-dbg.o : src/%.c
|
||
|
@mkdir -p dbg
|
||
|
@cc --debug $(CFLAGS) -c -o $@ $<
|
||
|
|
||
|
bld/fizzbuzz-dbg : dbg/main-dbg.o
|
||
|
@mkdir -p bld
|
||
|
@cc --debug $(CFLAGS) -o $@ $<
|
||
|
|
||
|
.PHONY : clean
|
||
|
clean :
|
||
|
@rm -rf obj bld dbg
|
||
|
|