This repository was archived by the owner on Mar 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (64 loc) · 1.98 KB
/
Makefile
File metadata and controls
87 lines (64 loc) · 1.98 KB
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
#
# QMM Makefile
# Adapted from the Quake3 Makefile from http://tremulous.net/Q3A-source/
#
include Config.mak
CC=g++
CC_C=gcc
BASE_CFLAGS=-pipe -m32
BROOT=linux
BR=$(BROOT)/release
BD=$(BROOT)/debug
OBJR=$(SRC_FILES:%.cpp=$(BR)/%.o) $(BR)/pdb.o
OBJD=$(SRC_FILES:%.cpp=$(BD)/%.o) $(BD)/pdb.o
DEBUG_CFLAGS=$(BASE_CFLAGS) -g -pg
RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -fPIC -fomit-frame-pointer -ffast-math -falign-loops=2 -falign-jumps=2 -falign-functions=2 -fno-strict-aliasing -fstrength-reduce
SHLIBCFLAGS=
#-fPIC
SHLIBLDFLAGS=-shared -m32
help:
@echo QMM supports the following make rules:
@echo release - builds release version
@echo debug - builds debug version
@echo clean - cleans all output files
release:
@echo ---
@echo --- building qmm \(release\)
@echo ---
$(MAKE) $(BR)/$(BINARY).so
@echo ---
@echo --- building pdb
@echo ---
$(MAKE) $(BR)/pdb.so
@echo ---
@echo --- Release build complete.
@echo ---
@echo --- Binaries are in linux/release
@echo ---
@echo --- Please read readme.txt for installation instructions.
@echo ---
debug: $(BD)/$(BINARY).so
$(BR)/$(BINARY).so: $(BR) $(OBJR)
$(CC) $(RELEASE_CFLAGS) $(SHLIBLDFLAGS) -o $@ $(OBJR)
$(BD)/$(BINARY).so: $(BD) $(OBJD)
$(CC) $(DEBUG_CFLAGS) $(SHLIBLDFLAGS) -o $@ $(OBJD)
$(BR)/pdb.o: pdb.c pdb.h
$(CC_C) $(RELEASE_CFLAGS) $(FLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(BD)/pdb.o: pdb.c pdb.h
$(CC_C) $(DEBUG_CFLAGS) $(FLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(BR)/%.o: %.cpp $(HDR_FILES)
$(CC) $(RELEASE_CFLAGS) $(FLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(BD)/%.o: %.cpp $(HDR_FILES)
$(CC) $(DEBUG_CFLAGS) $(FLAGS) $(SHLIBCFLAGS) -o $@ -c $<
$(BR)/pdb.so:
cd pdb/ && $(MAKE)
cp pdb/src/pdb.so $(BR)
$(BR):
@if [ ! -d $(BROOT) ];then mkdir $(BROOT);fi
@if [ ! -d $(@) ];then mkdir $@;fi
$(BD):
@if [ ! -d $(BROOT) ];then mkdir $(BROOT);fi
@if [ ! -d $(@) ];then mkdir $@;fi
clean:
@rm -rf $(BD) $(BR) $(BROOT)
cd pdb/ && $(MAKE) clean