-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (29 loc) · 1009 Bytes
/
Makefile
File metadata and controls
43 lines (29 loc) · 1009 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
include scripts/this.mk
level ?= -1
debug ?= no
CFLAGS := -std=gnu11 -fdiagnostics-color -Wall -Wextra -Wshadow -DLL_USE=$(level) -DVASQ_ALLOW_PLACEHOLDER -DVASQ_WARN_PLACEHOLDER
ifeq ($(debug),yes)
CFLAGS += -O0 -g -DDEBUG
else
CFLAGS += -O2 -DNDEBUG
endif
all: _all
VASQ_DIR := ./vanilla_squad
include vanilla_squad/make.mk
UTIL_DIR := ./util
include util/make.mk
VM_DIR := ./vm
include vm/make.mk
COMPILER_DIR := ./compiler
include compiler/make.mk
ROOT_EXTERNAL_DIRS := $(patsubst %,$(COMPILER_DIR)/%,$(COMPILER_SUBDIRS)) $(VM_DIR) $(UTIL_DIR) $(VASQ_INCLUDE_DIR)
$(eval $(call build_dir,ROOT,.,,$(ROOT_EXTERNAL_DIRS)))
BINARIES := scanner_check parser_check
STATIC_LIBRARIES := $(COMPILER_STATIC_LIBRARIES) $(VM_STATIC_LIBRARY) $(UTIL_STATIC_LIBRARY) $(VASQ_STATIC_LIBRARY)
.PHONY: all _all staticlibs clean $(CLEAN_TARGETS)
_all: $(BINARIES)
staticlibs: $(STATIC_LIBRARIES)
%_check: %_check.o $(STATIC_LIBRARIES)
$(CC) -o $@ $^
clean: $(CLEAN_TARGETS)
@rm -f $(BINARIES) $(DEPS_FILES)