-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 780 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 780 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
P_NAME = rpg_engine
OBJECTS = main.o map.o game_unit.o graphic.o user_interface.o menu.o settings.o joystick.o framerate.o game.o damage.o
# flags
CFLAGS = -Wall -O2 `sdl-config --cflags` -I.
LDFLAGS = `sdl-config --libs` -lSDL_gfx -lSDL_image -lSDL_ttf -lSDL_mixer
# main application
$(P_NAME)/$(P_NAME): $(OBJECTS:%.o=obj/%.o)
mkdir -p $(P_NAME)
$(CC) $(OBJECTS:%.o=obj/%.o) $(LDFLAGS) -o $(P_NAME)/$(P_NAME)
map_editor: obj/map.o obj/map_editor.o
$(CC) obj/map.o obj/map_editor.o $(LDFLAGS) -o $(P_NAME)/map_editor
# compile objects
obj/%.o: %.c
mkdir -p obj
$(CC) $(CFLAGS) -c $<
mv *.o obj
# run application
run: $(P_NAME)/$(P_NAME)
cd $(P_NAME) && ./$(P_NAME)
# additional stuff
clean:
- rm -rf $(P_NAME)/$(P_NAME) $(P_NAME)/map_editor $(P_NAME)/*.conf obj