-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
44 lines (31 loc) · 854 Bytes
/
makefile
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
44
# Time Slime Make File
CC = gcc
CC_FLAGS = -g -Wall
CC_ENDFLAGS = -lpthread
BUILD_DIR = build
SHELL_OUT = $(BUILD_DIR)/timeslime
SHELL_SOURCES = shell/shell.c shell/args/args.c
SHELL_HEADERS = shell/args/args.h
LIBRARY_SOURCES = timeslime.c third_party/sqlite3/sqlite3.c
LIBRARY_HEADERS = timeslime.h third_party/sqlite3/sqlite3.h
MKDIR = mkdir
ifeq ($(OS),Windows_NT)
RMDIR = cmd /C rmdir /S /Q
CC_FLAGS += -D WINDOWS
else
RMDIR = rmdir -f -r
CC_FLAGS += -D NOTWINDOWS
CC_ENDFLAGS += -ldl
endif
.PHONY: all
all: build_executable
# Enable debugging output
debug: CC_FLAGS += -DDEBUG
debug: all
build_executable: $(LIBRARY_SOURCES) $(LIBRARY_HEADERS) $(SHELL_SOURCES)
@$(CC) $(CC_FLAGS) $(LIBRARY_SOURCES) $(SHELL_SOURCES) -o $(SHELL_OUT) $(CC_ENDFLAGS)
prep:
@$(MKDIR) $(BUILD_DIR)
clean: clean_all
clean_all:
@$(RMDIR) $(SHELL_OUT)