-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
153 lines (131 loc) · 5.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
CC=gcc
CFLAGS=-g -Wall \
-Wfloat-equal \
-Wundef \
-Wshadow \
-Wpointer-arith \
-Wcast-qual \
-Wcast-align \
-Wstrict-prototypes \
-Wmissing-prototypes \
-Wunreachable-code \
-I/home/kims/VulkanSDK/1.0.51.0/x86_64/include
STR_SRC_FILES=NUS_string_group.c NUS_absolute_path.c
STR_DIR=strings
GPU_SRC_FILES=NUS_multi_gpu.c NUS_gpu.c NUS_queue_family.c NUS_submission_queue.c \
NUS_vulkan_instance.c NUS_binding.c NUS_memory_map.c NUS_uniform_buffer.c \
NUS_single_command.c
GPU_DIR=gpu
IO_SRC_FILES=NUS_window.c NUS_system_events.c
IO_DIR=io
MATH_SRC_FILES=NUS_vector.c NUS_octree.c NUS_matrix.c NUS_axes.c NUS_quaternion.c \
NUS_frustum.c NUS_reference_vector.c
MATH_DIR=math
MOD_SRC_FILES=NUS_model.c NUS_vertex.c NUS_skeleton.c \
NUS_keyframe.c NUS_animation.c NUS_binary_model.c NUS_frame.c
MOD_DIR=model
NUSM_SRC_FILES=NUS_load.c NUS_store.c NUS_read.c NUS_validate.c
NUSM_DIR=NUSM
COL_SRC_FILES=NUS_collidable.c NUS_aabb.c NUS_collision_info.c NUS_collision_type.c \
NUS_rigid_body.c NUS_point.c NUS_sphere.c NUS_box.c NUS_capsule.c
COL_DIR=physics/collision
PHY_SRC_FILES=NUS_kinematic_property.c NUS_physics_state.c NUS_orientation.c \
NUS_movement.c NUS_mass.c
PHY_DIR=physics
REN_SRC_FILES=NUS_presentation_surface.c NUS_shader.c NUS_image_view.c \
NUS_swapchain.c NUS_texture.c NUS_subpass_info.c NUS_render_pass.c \
NUS_framebuffer.c NUS_graphics_pipeline.c NUS_depth_buffer.c \
NUS_pipeline_layout.c NUS_sampler.c
REN_DIR=render
TIME_SRC_FILES=NUS_clock.c
TIME_DIR=time
STR_SRC=$(addprefix $(STR_DIR)/, $(STR_SRC_FILES))
GPU_SRC=$(addprefix $(GPU_DIR)/, $(GPU_SRC_FILES))
IO_SRC=$(addprefix $(IO_DIR)/, $(IO_SRC_FILES))
MATH_SRC=$(addprefix $(MATH_DIR)/, $(MATH_SRC_FILES))
MOD_SRC=$(addprefix $(MOD_DIR)/, $(MOD_SRC_FILES))
NUSM_SRC=$(addprefix $(NUSM_DIR)/, $(NUSM_SRC_FILES))
COL_SRC=$(addprefix $(COL_DIR)/, $(COL_SRC_FILES))
PHY_SRC=$(addprefix $(PHY_DIR)/, $(PHY_SRC_FILES))
REN_SRC=$(addprefix $(REN_DIR)/, $(REN_SRC_FILES))
TIME_SRC=$(addprefix $(TIME_DIR)/, $(TIME_SRC_FILES))
OTH_SRC=NUS_vulkan.c NUS_save.c NUS_library.c #NUS_entity.c NUS_population.c
STR_HEA=$(STR_SRC:.c=.h)
GPU_HEA=$(GPU_SRC:.c=.h)
IO_HEA=$(IO_SRC:.c=.h)
MATH_HEA=$(MATH_SRC:.c=.h)
MOD_HEA=$(MOD_SRC:.c=.h)
NUSM_HEA=$(NUSM_SRC:.c=.h)
COL_HEA=$(COL_SRC:.c=.h)
PHY_HEA=$(PHY_SRC:.c=.h)
REN_HEA=$(REN_SRC:.c=.h)
TIME_HEA=$(TIME_SRC:.c=.h)
OTH_HEA=NUS_result.h NUS_os.h NUS_key.h NUS_handle.h \
NUS_log.h NUS_bool.h $(OTH_SRC:.c=.h)
NUS_SRC_FILES=$(STR_SRC) $(GPU_SRC) $(IO_SRC) $(MATH_SRC) $(MOD_SRC) $(NUSM_SRC) \
$(PHY_SRC) $(REN_SRC) $(OTH_SRC) $(TIME_SRC)
NUS_HEA_PRE_PREFIX=$(OTH_HEA) $(NUS_SRC_FILES:.c=.h)
SRC_DIR=src
NUS_SRC=$(addprefix $(SRC_DIR)/, $(NUS_SRC_FILES))
NUS_HEA=$(addprefix $(SRC_DIR)/, $(NUS_HEA_PRE_PREFIX))
NUS_OBJ=$(NUS_SRC:.c=.o)
all: $(NUS_SRC) compile
compile: $(NUS_OBJ)
@echo "Files are compiled with flags: $(CFLAGS)"
@if [ -d "/usr/local/include/NUS/" ]; then \
sudo rm -rf /usr/local/include/NUS/*; fi
@if [ -f "/usr/local/lib/libNUS_library.a" ]; then \
sudo rm /usr/local/lib/libNUS_library.a; fi
@sudo ar rcs /usr/local/lib/libNUS_library.a $(NUS_OBJ)
@if [ ! -d "/usr/local/include/NUS" ]; then \
sudo mkdir /usr/local/include/NUS; fi
@if [ ! -d "/usr/local/include/NUS/$(STR_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(STR_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(GPU_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(GPU_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(IO_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(IO_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(MATH_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(MATH_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(MOD_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(MOD_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(NUSM_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(NUSM_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(PHY_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(PHY_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(COL_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(COL_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(REN_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(REN_DIR); fi
@if [ ! -d "/usr/local/include/NUS/$(TIME_DIR)" ]; then \
sudo mkdir /usr/local/include/NUS/$(TIME_DIR); fi
@sudo cp $(addprefix $(SRC_DIR)/, $(STR_HEA)) /usr/local/include/NUS/$(STR_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(GPU_HEA)) /usr/local/include/NUS/$(GPU_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(IO_HEA)) /usr/local/include/NUS/$(IO_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(MATH_HEA)) /usr/local/include/NUS/$(MATH_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(MOD_HEA)) /usr/local/include/NUS/$(MOD_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(NUSM_HEA)) /usr/local/include/NUS/$(NUSM_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(COL_HEA)) /usr/local/include/NUS/$(COL_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(PHY_HEA)) /usr/local/include/NUS/$(PHY_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(REN_HEA)) /usr/local/include/NUS/$(REN_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(TIME_HEA)) /usr/local/include/NUS/$(TIME_DIR)/
@sudo cp $(addprefix $(SRC_DIR)/, $(OTH_HEA)) /usr/local/include/NUS/
build_clean: clean all
cd NUSM/; make
.c.o:
@echo "Compiling File: $<"
@$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
recompile: build_clean
cd unit_tests/; make recompile
debug: CFLAGS += -D NUS_DEBUG
debug: build_clean
cd unit_tests/; make debug
clean:
@find . -type f \( -name '*.o' -o -name '*~' \) -delete
@cd unit_tests/; make clean
install:
sudo apt-get install libx11-xcb-dev libx11-dev libxi-dev \
libglm-dev graphviz libxcb-dri3-0 libxcb-present0 libpciaccess0 cmake \
libpng-dev libxcb-dri3-dev libmirclient-dev libwayland-dev \
xorg-dev build-essential