forked from hissorii/px68k
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·180 lines (140 loc) · 3.73 KB
/
Makefile
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
include version.txt
CC = gcc
CXX = c++
CXXLINK = $(CXX)
RM = rm -f
TAGS = etags
DEPEND = gccmakedep
DEPEND_DEFINES =
# Enable Cyclone M68k ASM Emu
#CYCLONE = 1
# for debug
CDEBUGFLAGS = -g -O0 -fno-strict-aliasing
#
# enable SDL_gfx
#
#CDEBUGFLAGS+= -DUSE_SDLGFX
#
# disable sound
#
#CDEBUGFLAGS+= -DNO_SOUND
#
# disable mercury unit
#
CDEBUGFLAGS+= -DNO_MERCURY
#
# enable RFMDRV
#
#CDEBUGFLAGS+= -DRFMDRV
#
# for Opt.
#
CDEBUGFLAGS = -O2
CDEBUGFLAGS+= -funroll-loops
CDEBUGFLAGS+= -fomit-frame-pointer
CDEBUGFLAGS+= -ffast-math
CDEBUGFLAGS+= -ftree-vectorize
CDEBUGFLAGS+= -DNDEBUG -g
# CDEBUGFLAGS+= -march=pentium-m
# CDEBUGFLAGS+= -msse -mfpmath=sse
#
# for DEBUG
#
# CDEBUGFLAGS= -O0
# CDEBUGFLAGS+= -g
# CDEBUGFLAGS+= -W -Wall -Wuninitialized
# CDEBUGFLAGS+= -Wunused
# CDEBUGFLAGS+= -Werror
# CDEBUGFLAGS+= -DINLINE=
# CDEBUGFLAGS+= -DUSE_GAS
CDEBUGFLAGS+=-DPX68K_VERSION=$(PX68K_VERSION)
ifdef SDL2
# SDL 2.0
SDL_CONFIG?= sdl2-config
else
# SDL 1.2
SDL_CONFIG?= sdl-config
endif
SDL_INCLUDE= `$(SDL_CONFIG) --cflags`
ifdef SDL2
SDL_LIB= `$(SDL_CONFIG) --libs` -lSDL2_gfx
else
SDL_LIB= `$(SDL_CONFIG) --libs`
# -lSDL_gfx
endif
ifeq ($(shell uname -m),armv6l)
MOPT=
else
ifeq ($(PYRA),1)
CDEBUGFLAGS+= -DPYRA
CDEBUGFLAGS+= -DUSE_OGLES11
SDL_LIB= `$(SDL_CONFIG) --libs`
SDL_LIB+= -L/opt/omap5-sgx-ddk-um-linux/lib -lGLES_CM -lEGL
MOPT=-mcpu=cortex-a15 -mfpu=neon -mfloat-abi=hard -fsigned-char -fsingle-precision-constant -marm
CYCLONE = 1
else
ifeq ($(shell uname -m),armv7l)
CDEBUGFLAGS+= -DPANDORA
CDEBUGFLAGS+= -DUSE_OGLES11
SDL_LIB= `$(SDL_CONFIG) --libs`
SDL_LIB+= -lGLES_CM -lEGL
MOPT= -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fsigned-char -fsingle-precision-constant
# -flto -flto-odr-type-merging
#Config for Pandora, enable Cyclone
CYCLONE = 1
else
MOPT= -m32
endif
endif
endif
ifdef CYCLONE
CDEBUGFLAGS += -DCYCLONE
endif
LDLIBS = -lm
EXTRA_INCLUDES= -I./x11 -I./x68k -I./fmgen -I./win32api $(SDL_INCLUDE)
CDEBUGFLAGS += -DC68K_NO_JUMP_TABLE
CXXDEBUGFLAGS= $(CDEBUGFLAGS)
CFLAGS= $(MOPT) $(CDEBUGFLAGS) $(EXTRA_INCLUDES)
CXXFLAGS= $(MOPT) $(CXXDEBUGFLAGS) $(EXTRA_INCLUDES)
CXXLDOPTIONS= $(CXXDEBUGFLAGS)
CPUOBJS= x68k/d68k.o m68000/m68000.o
ifdef CYCLONE
CPUOBJS += \
m68000/cyclone.o
else
CPUOBJS += \
m68000/c68k/c68k.o m68000/c68k/c68kexec.o
endif
X68KOBJS= x68k/adpcm.o x68k/bg.o x68k/crtc.o x68k/dmac.o x68k/fdc.o x68k/fdd.o x68k/disk_d88.o x68k/disk_dim.o x68k/disk_xdf.o x68k/gvram.o x68k/ioc.o x68k/irqh.o x68k/mem_wrap.o x68k/mercury.o x68k/mfp.o x68k/palette.o x68k/midi.o x68k/pia.o x68k/rtc.o x68k/sasi.o x68k/scc.o x68k/scsi.o x68k/sram.o x68k/sysport.o x68k/tvram.o
FMGENOBJS= fmgen/fmgen.o fmgen/fmg_wrap.o fmgen/file.o fmgen/fmtimer.o fmgen/opm.o fmgen/opna.o fmgen/psg.o
X11OBJS= x11/joystick.o x11/juliet.o x11/keyboard.o x11/mouse.o x11/prop.o x11/status.o x11/timer.o x11/dswin.o x11/windraw.o x11/winui.o x11/about.o x11/common.o
X11CXXOBJS= x11/winx68k.o
WIN32APIOBJS= win32api/dosio.o win32api/fake.o win32api/peace.o
ifeq ($(shell uname -m),armv7l)
X11OBJS+= x11/eglport.o
endif
COBJS= $(X68KOBJS) $(X11OBJS) $(WIN32APIOBJS) $(CPUOBJS)
CXXOBJS= $(FMGENOBJS) $(X11CXXOBJS)
OBJS= $(COBJS) $(CXXOBJS)
CSRCS= $(COBJS:.o=.c)
CXXSRCS= $(CXXOBJS:.o=.cpp)
SRCS= $(CSRCS) $(CXXSRCS)
.SUFFIXES: .c .cpp
.c.o:
$(CC) -o $@ $(CFLAGS) -c $*.c
.cpp.o:
$(CXX) -o $@ $(CXXFLAGS) -c $*.cpp
.s.o:
$(CC) -o $@ $(CFLAGS) -c $*.s
all:: px68k
px68k: $(OBJS)
$(RM) $@
$(CXXLINK) $(MOPT) -o $@ $(CXXLDOPTIONS) $(OBJS) $(SDL_LIB) $(LDLIBS)
depend::
$(DEPEND) -- $(CXXFLAGS) $(DEPEND_DEFINES) -- $(SRCS)
clean::
$(RM) px68k
$(RM) $(OBJS)
$(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut "#"*
tags::
find . -name "*.h" -o -name "*.c" -o -name "*.cpp" | $(TAGS) -