forked from ethansbrown/acpc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
44 lines (30 loc) · 1.19 KB
/
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
CC = gcc
CC_FLAGS = -O3 -Wall -pedantic -ansi
CC_INCLUDE=-Iinclude
LIB_DIR = lib
SRC_DIR = src
OUT_DIR = out
OBJ_DIR = $(OUT_DIR)/obj
BIN_DIR = $(OUT_DIR)/bin
LIB_FILES = $(wildcard $(LIB_DIR)/*.c)
OBJ_FILES = $(patsubst $(LIB_DIR)/%.c,$(OBJ_DIR)/%.o,$(LIB_FILES))
PROGRAMS = all_in_expectation bm_server bm_widget bm_run_matches dealer example_player
all: $(PROGRAMS)
clean:
rm -rf $(OUT_DIR)
pre-build:
mkdir -p $(OBJ_DIR) $(BIN_DIR)
all_in_expectation: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
bm_server: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
bm_widget: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
bm_run_matches: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
dealer: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
example_player: pre-build $(OBJ_FILES)
$(CC) $(CC_FLAGS) $(CC_INCLUDE) $(OBJ_FILES) -o $(BIN_DIR)/$@ $(SRC_DIR)/[email protected]
$(OBJ_DIR)/%.o: $(LIB_DIR)/%.c
$(CC) $(CC_FLAGS) $(CC_INCLUDE) -c -o $@ $<