-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
42 lines (31 loc) · 1004 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
SRC_DIR := ./src/persistence/
DEFAULT_DIR := ./Default/
ODB := odb --output-dir $(SRC_DIR)
SCHEMA_FILES=$(addprefix $(SRC_DIR), Game.h Bet.h Win.h GameConfiguration.h PlayHistory.h Session.h MachineConfiguration.h Account.h DoorState.h BillStackerAccess.h PowerState.h Event.h GameHistoryInfo.h)
odb: clean_files _odb1 _odb2
.PHONY: odb
_odb1: $(SCHEMA_FILES)
$(ODB) --generate-schema-only --database pgsql --at-once --input-name database $^
_odb2: $(SCHEMA_FILES)
$(foreach file, $^, $(ODB) --database pgsql --generate-query $(file);)
pictures:
@mkdir -p $(DEFAULT_DIR)
cp -rf ./res/* $(DEFAULT_DIR)
format:
astyle *.cpp *.h --indent=force-tab --style=java / -A2 --recursive
clean: clean_files _clean_default_dir
.PHONY: clean
clean_files:
$(RM) $(SRC_DIR)/*.ixx
$(RM) $(SRC_DIR)/*.cxx
$(RM) $(SRC_DIR)/*.hxx
$(RM) $(SRC_DIR)/*.sql
_clean_default_dir:
$(RM) -rf $(DEFAULT_DIR)
.PHONY: help
help:
@echo 'Targets:'
@echo 'odb'
@echo 'format'
@echo 'pictures'
@echo 'clean'