1 ifneq ("$(WIN32)", "1")
2 GTK_FLAGS
:= $(shell pkg-config gtk
+-2.0 --cflags) -D_GTK2
3 GTK_LIBS
:= $(shell pkg-config gtk
+-2.0 --libs
)
4 #GTK_LIBS := -lgtk-x11-2.0
7 UNAME
:= $(shell uname
-m
)
8 ifeq ("$(UNAME)","x86_64")
14 ifneq ("$(WIN32)", "1")
15 CC
= gcc
-march
=athlon64
16 CXX
= g
++ -march
=athlon64
17 LD
= g
++ -march
=athlon64
19 SDL_CFLAGS
:= $(shell sdl-config
--cflags)
20 SDL_LIBS
:= $(shell sdl-config
--libs
)
21 GLIDE_CFLAGS
= -Wall
-g
-DGCC
-DUSE_GTK
$(SDL_GLIDE_CFLAGS
) $(GTK_FLAGS
) -Iwrapper
/ -ffast-math
# -funroll-loops -fexpensive-optimizations #-fomit-frame-pointer
26 #CFLAGS = -O1 -save-temps# -dA
27 LDFLAGS
= -g
-shared
-Wl
,-Bsymbolic
-lGL
-lGLU
-L
/usr
/X11R6
/lib
$(SDL_LIBS
)
28 ifeq ("$(VPDEBUG)", "1")
29 GLIDE_CFLAGS
+= -DVPDEBUG
32 LDFLAGS
+= -fomit-frame-pointer
38 STRIP
= $(TOOL_PREFIX
)strip
39 WINDRES
= $(TOOL_PREFIX
)windres
41 MSVCP
=/mnt
/big1
/msvc7.1
/Vc7
42 MSVCP2
=I
:\\mnt
\\big1
\\msvc7.1
\\Vc7
43 #MSVC_TOOLS_PREFIX= (pkill -9 wine && sleep 0.1 || true) && wine --debugmsg -all -- $(MSVCP)/bin/
44 MSVC_TOOLS_PREFIX
= wine
$(MSVCP
)/bin
/
45 #MSVC_TOOLS_PREFIX=wine --debugmsg -all -- /mnt/windaube/msvc7.1/Vc7/bin/
46 MSVC_CFLAGS
= -I
$(MSVCP2
)\\include -I
$(MSVCP2
)\\PlatformSDK
\\Include
47 MSVC_LDFLAGS
= -LIBPATH
:$(MSVCP2
)\\lib
-LIBPATH
:$(MSVCP2
)\\PlatformSDK
\\Lib
49 CC
= $(MSVC_TOOLS_PREFIX
)cl
52 LD
= $(MSVC_TOOLS_PREFIX
)link
56 DEFINES
+= -DWIN32
-D_WINDOWS
-DNT_PLUGIN
-D_WIN32
58 GLIDE_CFLAGS
= $(DEFINES
) $(MSVC_CFLAGS
)
59 GLIDE_CFLAGS
+= -Iwrapper
60 GLIDE_CFLAGS
+= -Ot
-Ox
62 SYSLIBS
+= Gdi32.lib winspool.lib comdlg32.lib Opengl32.lib
63 SYSLIBS
+= advapi32.lib ole32.lib oleaut32.lib uuid.lib
64 SYSLIBS
+= odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib
65 SYSLIBS
+= kernel32.lib user32.lib shell32.lib ws2_32.lib winmm.lib
-subsystem
:windows libcmt.lib
67 LDFLAGS
= $(MSVC_LDFLAGS
) -dll
$(SYSLIBS
)
71 # -export:GetDllInfo \
75 CPPFLAGS
= $(GLIDE_CFLAGS
)
79 CC
= $(TOOL_PREFIX
)gcc
80 CXX
= $(TOOL_PREFIX
)g
++
81 LD
= $(TOOL_PREFIX
)g
++
82 GLIDE_CFLAGS
= -mno-cygwin
-DGCC
-Iwrapper
/ -O2
-ffast-math
-funroll-loops
-fomit-frame-pointer
83 LDFLAGS
= -mno-cygwin
-shared
-lole32
-luuid
-lcomctl32
-lwinspool
-lws2_32
-lwsock32
-lopengl32
-lglu32
-lglut32
-mno-cygwin
-mwindows
-mconsole
90 #GLIDE_CFLAGS = -DUSE_GTK `sdl-config --cflags` $(GTK_FLAGS) -Iwrapper/ -O2 -g
91 CPPFLAGS
= $(GLIDE_CFLAGS
)
105 DepthBufferRender.
$(O
)
108 wrapper
/combiner.
$(O
) \
109 wrapper
/textures.
$(O
) \
111 wrapper
/geometry.
$(O
) \
112 wrapper
/config.
$(O
) \
113 wrapper
/filter.
$(O
) \
126 W32WRAPPEROBJECTS
= \
127 wrapper
/Script1.
$(RES
) \
130 ifneq ("$(WIN32)", "1")
131 OBJECTS
+= $(GTKOBJECTS
) $(WRAPPEROBJECTS
)
133 all: $(TARGET
) instruction
135 GLIDE_CFLAGS
+= -MMD
-MP
-MQ
$@
136 DEPS
:= $(OBJECTS
:.
$(O
)=.d
) compiletex.d
137 ifneq ($(MAKECMDGOALS
),clean)
141 WRAPPEROBJECTS
+= $(W32WRAPPEROBJECTS
)
142 OBJECTS
+= $(W32OBJECTS
)
144 all: compileglide
$(TARGET
) instruction
145 ifeq ("$(GLIDE)", "1")
146 GLIDE_CFLAGS
+= -DGLIDEXPORT
147 #LDFLAGS+= -Wl,--image-base=0x18000000
149 LDFLAGS
+= glide3x.dll
# -Wl,--image-base=0x10000000
153 $(TARGET
): $(OBJECTS
)
154 $(LD
) $(GTK_LIBS
) $(LOUT
)$@
$(OBJECTS
) $(LDFLAGS
)
155 # $(LD) -shared $(GTK_LIBS) $(LOUT)$@ $(OBJECTS) $(LDFLAGS)
156 # strip --strip-all $@
157 ifeq ("$(WIN32)", "1")
158 ifneq ("$(MSVC)", "1")
159 # don't know why a .comment section is being added, but it prevents the dll
161 $(STRIP
) -R .comment
$@
166 make WIN32
=0 compiletex
167 make GLIDE
=1 glide3x.dll
169 glide3x.dll
: $(WRAPPEROBJECTS
)
170 $(LD
) $(GTK_LIBS
) $(LOUT
)$@
$(WRAPPEROBJECTS
) $(LDFLAGS
)
171 # $(LD) -shared $(GTK_LIBS) $(LOUT)$@ $(OBJECTS) $(LDFLAGS)
172 # strip --strip-all $@
173 ifneq ("$(MSVC)", "1")
174 $(STRIP
) -R .comment
$@
177 Main.
$(O
): font.h cursor.h
179 .
/compiletex font.
tex font.h font
182 .
/compiletex cursor.
tex cursor.h cursor
184 compiletex
: compiletex.o
185 $(LD
) -o
$@ compiletex.o
187 instruction
: $(TARGET
)
188 @echo please copy
$(TARGET
) AND Glide64.ini in the plugins
/ folder of the emulator
191 rm -rf
$(OBJECTS
) $(ALL
) $(DEPS
) compiletex compiletex.
$(O
) font.h cursor.h
202 .SUFFIXES
: .
$(O
) .
cpp .c
204 # in case this was invoked because a header changed and the compilation fails,
205 # the record of dependency in the .d is gone, but not the .o
207 $(CXX
) $(CFLAGS
) $(CPPFLAGS
) $< $(COUT
)$@
211 $(CC
) $(CFLAGS
) $(GLIDE_CFLAGS
) $< $(COUT
)$@
216 $(MSVC_TOOLS_PREFIX
)rc
-I
$(MSVCP2
)/atlmfc
/include -I
$(MSVCP2
)/PlatformSDK
/Include
/ $<
218 .PHONY
: all instruction
clean rebuild