summaryrefslogtreecommitdiff
path: root/PcsxSrc/Linux/Makefile
blob: 3f194c99d810a9034efa5832c07dfe3e0607fc1b (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
#
# PCSX Makefile for Linux
#

MAJ = 1
MIN = 3
VERSION = ${MAJ}.${MIN}

all: pcsx

CPU = ix86

CC = gcc
NASM = nasm
RM = rm -f
STRIP = strip

OPTIMIZE = -O2 -fomit-frame-pointer -finline-functions -ffast-math
FLAGS = -D__LINUX__ -DPCSX_VERSION=\"${VERSION}\"
# this includes the option -rdynamic and we don't want that
LIBST = $(shell gtk-config --libs)
#LIBS = $(subst -rdynamic, , ${LIBST}) -lz
LIBS = ${LIBST} -lz

OBJS = ../PsxBios.o ../CdRom.o ../PsxCounters.o ../PsxDma.o ../DisR3000A.o \
       ../Spu.o ../Sio.o ../PsxHw.o ../Mdec.o ../PsxMem.o ../Misc.o \
       ../plugins.o ../Decode_XA.o ../R3000A.o ../PsxInterpreter.o \
       ../Gte.o ../PsxHLE.o
OBJS+= LnxMain.o Plugin.o Config.o GtkGui.o
OBJS+= GladeGui.o GladeFuncs.o #GladeCalls.o

ifeq (${CPU}, ix86)
	CC = gcc
	OPTIMIZE = -O4 -fomit-frame-pointer -finline-functions -ffast-math -fno-exceptions -march=pentiumpro
	OBJS+= ../ix86/iR3000A.o ../ix86/ix86.o
	FLAGS+= -D__i386__
endif

CFLAGS = -Wall ${OPTIMIZE} -I. -I.. -I/usr/include/g++ ${FLAGS}
CFLAGS+= $(shell gtk-config --cflags)
ASMFLAGS = -f elf ${FLAGS} -i./ -i../

GladeGui.c: pcsx.glade
	glade -w pcsx.glade

GladeFuncs.c: pcsx.glade
	glade -w pcsx.glade

pcsx: ${OBJS}
	${CC} ${CFLAGS} ${OBJS} -o pcsx ${LIBS}
#	${STRIP} pcsx

.PHONY: clean pcsx

clean:
	${RM} *.o ../*.o ../${CPU}/*.o pcsx
 GladeGui.* GladeFuncs.*

../%.o: ../%.c
	${CC} ${CFLAGS} -c -o $@ $<

../${CPU}/%.o: ../${CPU}/%.asm
	${NASM} ${ASMFLAGS} -o $@ $<

%.o: %.c
	${CC} ${CFLAGS} -c -o $@ $<

../Cpu/ix86/%.o: ../Cpu/ix86/%.c
	${CC} ${CFLAGS} -c -o $@ $<