holey-toys/Makefile

37 lines
821 B
Makefile
Raw Permalink Normal View History

2024-03-04 14:38:46 -06:00
CC = gcc
CFLAGS_EXTRA =
CFLAGS = -Wall -Wextra -Wpedantic -std=c17 -O3
2024-03-11 09:00:55 -05:00
CLANG_FORMAT_STYLE = '{ BasedOnStyle: Google, IndentWidth: 4 }'
2024-03-04 14:24:03 -06:00
2024-03-11 09:00:55 -05:00
.PHONY: clean hbas example format check-format
2024-03-04 14:24:03 -06:00
2024-03-11 06:41:02 -05:00
hbas: build/hbas
example: build/example.hbf
2024-03-17 14:31:42 -05:00
hello: build/hello.hbf
2024-03-11 06:41:02 -05:00
2024-03-11 09:00:55 -05:00
format:
clang-format --style=${CLANG_FORMAT_STYLE} -i src/*
check-format:
clang-format --style=${CLANG_FORMAT_STYLE} -i --dry-run -Werror src/*
2024-03-11 06:41:02 -05:00
build:
mkdir -p build
2024-03-17 11:18:41 -05:00
build/hbas: build $(wildcard src/*.h src/*.c)
2024-03-08 05:23:47 -06:00
${CC} ${CFLAGS} ${CFLAGS_EXTRA} src/hbas.c -o build/hbas
2024-03-04 14:24:03 -06:00
2024-03-11 06:41:02 -05:00
build/example.hbf: build build/hbas examples/example.S
2024-03-11 06:45:44 -05:00
./build/hbas < examples/example.S > build/example.hbf
2024-03-11 06:41:02 -05:00
xxd build/example.hbf
2024-03-04 14:24:03 -06:00
2024-03-17 14:31:42 -05:00
build/hello.hbf: build build/hbas examples/hello.S
./build/hbas < examples/hello.S > build/hello.hbf
xxd build/hello.hbf
2024-03-04 14:24:03 -06:00
clean:
2024-03-11 06:41:02 -05:00
rm -rf build
2024-03-04 14:24:03 -06:00
all:
2024-03-11 06:45:44 -05:00
hbas