progtests/c/fizzbuzz/makefile

37 lines
612 B
Makefile
Raw Normal View History

2023-10-13 18:32:44 +01:00
########################
# (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