-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 667 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 667 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
# Compiler
CC = gcc
OPTS = -std=gnu11 -pedantic -g -O3
# Project name
PROJECT = blarb
SRC_DIR = 'src'
OBJ_DIR = 'obj'
SRCS = src/debugger.c src/main.c src/scanner.c src/vm.c
ifeq ($(BLARB_LIBRARY_PATH),)
BLARB_LIBRARY_PATH = $(shell pwd)/library
endif
OPTS += -DBLARB_LIBRARY_PATH="\"$(BLARB_LIBRARY_PATH)\""
OS = $(shell uname -s)
ifeq ($(OS),Darwin)
SRCS += src/syscall_macos.c
else ifeq ($(OS),Linux)
SRCS += src/syscall_linux.c
endif
# Targets
$(PROJECT): buildrepo compileScanner
$(CC) $(OPTS) $(SRCS) -o $@
clean:
rm $(PROJECT) $(OBJ_DIR) -Rf
compileScanner:
lex -o $(OBJ_DIR)/blarb.yy.c $(SRC_DIR)/blarb.lex
buildrepo:
mkdir -p $(OBJ_DIR)