-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.country
100 lines (80 loc) · 3.55 KB
/
Makefile.country
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
# D-Day: Normandy by Vipersoft
# ************************************
# * $Source: /usr/local/cvsroot/dday/src/pol/Makefile,v $
# * $Revision: 1.6 $
# * $Date: 2002/07/25 09:07:45 $
# *
# ***********************************
#
# Copyright (C) 2002 Vipersoft
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# This nice line comes from the linux kernel makefile
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)
#ARCH=i386
#ARCH=x86_64
CC=gcc
BASE_CFLAGS=-Dstricmp=strcasecmp -I..
#CFLAGS_RELEASE=$(BASE_CFLAGS) -O1
# Nick - fixed 'make build_release' flags.
CFLAGS_RELEASE=$(BASE_CFLAGS) -O3 -funroll-loops \
-fomit-frame-pointer -fexpensive-optimizations
# Nick - fixed 'make build_debug' flags.
CFLAGS_DEBUG=$(BASE_CFLAGS) -g
# Always uncommented
ifeq ($OSTYPE),FreeBSD)
LDFLAGS=-lm
endif
ifeq ($(OSTYPE),Linux)
LDFLAGS=-lm -ldl
endif
SHLIBEXT=so
SHLIBCFLAGS=-fPIC
SHLIBLDFLAGS=-shared
DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
build_debug:
$(MAKE) $(COUNTRY_CODE)$(ARCH).$(SHLIBEXT) CFLAGS="$(CFLAGS_DEBUG)"
build_release:
$(MAKE) $(COUNTRY_CODE)$(ARCH).$(SHLIBEXT) CFLAGS="$(CFLAGS_RELEASE)"
#############################################################################
# SETUP AND BUILD
# GAME
#############################################################################
.c.o:
$(DO_CC)
GAME_OBJS = $(COUNTRY_CODE)_item.o $(COUNTRY_CODE)_spawn.o $(COUNTRY_CODE)_guninfo.o $(COUNTRY_CODE)_weapon.o $(COUNTRY_CODE)_main.o
# g_so.o # this file is a shared library thingie needed for Solaris
$(COUNTRY_CODE)$(ARCH).$(SHLIBEXT) : $(GAME_OBJS)
$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) $(LDFLAGS)
#############################################################################
# MISC
#############################################################################
clean:
-rm -f $(GAME_OBJS)
-rm -f $(COUNTRY_CODE)$(ARCH).$(SHLIBEXT)
depend:
gcc -MM $(GAME_OBJS:.o=.c)
$(COUNTRY_CODE)_item.o: $(COUNTRY_CODE)_item.c $(COUNTRY_CODE)_main.h $(COUNTRY_CODE)_defines.h ../g_local.h ../g_defines.h \
../q_shared.h ../game.h ../p_menu.h ../g_cmds.h
$(COUNTRY_CODE)_spawn.o: $(COUNTRY_CODE)_spawn.c $(COUNTRY_CODE)_main.h $(COUNTRY_CODE)_defines.h ../g_local.h ../g_defines.h \
../q_shared.h ../game.h ../p_menu.h ../g_cmds.h
$(COUNTRY_CODE)_guninfo.o: $(COUNTRY_CODE)_guninfo.c $(COUNTRY_CODE)_main.h $(COUNTRY_CODE)_defines.h ../g_local.h ../g_defines.h \
../q_shared.h ../game.h ../p_menu.h ../g_cmds.h
$(COUNTRY_CODE)_weapon.o: $(COUNTRY_CODE)_weapon.c $(COUNTRY_CODE)_main.h $(COUNTRY_CODE)_defines.h ../g_local.h ../g_defines.h \
../q_shared.h ../game.h ../p_menu.h ../g_cmds.h
$(COUNTRY_CODE)_main.o: $(COUNTRY_CODE)_main.c $(COUNTRY_CODE)_main.h $(COUNTRY_CODE)_defines.h ../g_local.h ../g_defines.h ../q_shared.h \
../game.h ../p_menu.h ../g_cmds.h