summaryrefslogtreecommitdiff
blob: 467e49445ec44d69f134bc66d3ab31517be18e2e (plain)
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
--- Makefile.orig	2010-01-24 02:21:57.196476493 -0500
+++ Makefile	2010-01-24 02:27:52.134475800 -0500
@@ -3,19 +3,20 @@
 # By R. Belmont
 #
 
-CC   = gcc
-CPP  = g++
-CFLAGS = -c -O3 -g3
-CFLAGS += -DNST_PRAGMA_ONCE_SUPPORT -D_SZ_ONE_DIRECTORY
-CFLAGS += -Isource -Isource/core -Isource/zlib -Isource/core/api -Isource/core/board -Isource/core/input -Isource/linux/unzip 
-CFLAGS += -Isource/core/vssystem -Isource/linux -Isource/nes_ntsc -I.. -I../nes_ntsc -Isource/linux/7zip 
-CFLAGS += `sdl-config --cflags` `pkg-config --cflags gtk+-2.0`
-CFLAGS += -finline-limit=2000 --param inline-unit-growth=1000 --param large-function-growth=1000 -finline-functions-called-once
+FLAGS = -c \
+	-DNST_PRAGMA_ONCE_SUPPORT -D_SZ_ONE_DIRECTORY \
+	-Isource -Isource/core -Isource/zlib -Isource/core/api -Isource/core/board -Isource/core/input -Isource/linux/unzip  \
+	-Isource/core/vssystem -Isource/linux -Isource/nes_ntsc -I.. -I../nes_ntsc -Isource/linux/7zip  \
+	`sdl-config --cflags` `pkg-config --cflags gtk+-2.0` \
+	-finline-limit=2000 --param inline-unit-growth=1000 --param large-function-growth=1000 -finline-functions-called-once
+
+CFLAGS += $(FLAGS)
+CXXFLAGS += $(FLAGS)
 
 # enable this for input debugging
 #CFLAGS += -DDEBUG_INPUT
 
-CPPFLAGS = -Wno-deprecated -fno-rtti
+CXXFLAGS += -Wno-deprecated -fno-rtti
 
 EXE  = nst
 LIBS = -lm -lz -lasound  `sdl-config --libs` `pkg-config --libs gtk+-2.0`
@@ -144,6 +145,8 @@
 OBJDIRS = objs objs/core objs/core/api objs/core/board objs/core/input objs/core/vssystem objs/nes_ntsc 
 OBJDIRS += objs/linux objs/linux/7zip objs/linux/unzip
 
+$(shell mkdir $(sort $(OBJDIRS)))
+
 # build rules
 objs/%.o: source/%.c
 	@echo Compiling $<...
@@ -151,24 +154,19 @@
 
 objs/%.o: source/%.cpp
 	@echo Compiling $<...
-	@$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@
+	$(CC) $(CXXFLAGS) $< -o $@
 
 objs/%.o: source/%.o
 	@echo Compiling $<...
 	@$.o) $(CFLAGS) $.oFLAGS) $< -o $@
 
-all: maketree $(EXE) $(GENNSTCONTROLS)
-
-maketree: $(sort $(OBJDIRS))
+all: $(EXE) $(GENNSTCONTROLS)
 
-$(sort $(OBJDIRS)):
-	@echo Creating output directory $@
-	@mkdir $@
 
 # link the commandline exe
 $(EXE): $(OBJS)
 	@echo Linking $@...
-	@$(CPP) -g -o $(EXE) $^ $(LIBS)
+	$(CXX) $(LDFLAGS) -g -o $(EXE) $^ $(LIBS)
 
 clean:
 	-@rm -f $(OBJS) $(EXE) $(GENNSTCONTROLS)