-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 752 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SRC_FILES = src/main.c src/program_builder.c src/program.c src/vm.c src/opcodes.c src/core.c src/assembler.c
BUILD_DIR = build
SYM_PATH = ./vm
CC_FLAGS = -Wall -Wpedantic -Wextra -Wno-variadic-macros -Wimplicit-fallthrough -Werror -g -std=c11
INCLUDES = -Iinclude
BUILD_OPTIONS = -DDEBUG=0 -DVERBOSE=0
CC = clang
all: build prog link
run: build exec
exec:
${BUILD_DIR}/vm
build:
mkdir -p ${BUILD_DIR}
prog:
${CC} ${SRC_FILES} ${CC_FLAGS} ${BUILD_OPTIONS} -o ${BUILD_DIR}/vm ${INCLUDES}
link:
rm -f ${SYM_PATH} && ln -s ${BUILD_DIR}/vm ${SYM_PATH}
sanitize:
${CC} ${SRC_FILES} ${CC_FLAGS} ${BUILD_OPTIONS} -o ${BUILD_DIR}/vm ${INCLUDES} -fsanitize=address -fno-omit-frame-pointer -g -O0
clean:
rm -rf ${BUILD_DIR}/** && rm -f ${SYM_PATH}