-
Notifications
You must be signed in to change notification settings - Fork 7
/
makefile.linux
60 lines (40 loc) · 1.66 KB
/
makefile.linux
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
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
CC = gcc
LD = $(CC)
AS = $(CC)
INSTALL = /usr/bin/install -c
CFLAGS = -std=c99 -Wall -O3 -I./include
LDFLAGS = $(CFLAGS) -s `sdl2-config --cflags --libs`
ASFLAGS = $(CFLAGS)
TARGETS = sdl2gnuboy
# add -DDEBUG to enable debugging output
SYS_DEFS = -DIS_LITTLE_ENDIAN -DIS_LINUX
SYS_OBJS = sys/nix/nix.o ./sys/nix/io.o ./sys/nix/io_pipe.o ./sys/nix/io_none.o ./sys/nix/io_network.o
SYS_INCS = -I/usr/local/include -I./sys/nix
SDL_OBJS = sys/sdl2/sdl-video.o sys/sdl2/sdl-audio.o sys/sdl2/sdl-input.o
SDL_LIBS = -L/usr/lib -lSDL2 -lpthread
SDL_CFLAGS = -I/usr/include/SDL2 -D_GNU_SOURCE=1 -D_REENTRANT `sdl2-config --cflags --libs`
all: $(TARGETS)
XZ_OBJS = lib/xz/xz_crc32.o lib/xz/xz_crc64.o lib/xz/xz_dec_lzma2.o lib/xz/xz_dec_stream.o lib/xz/xz_dec_bcj.o
OBJS = ./src/lcd.o ./src/refresh.o ./src/lcdc.o ./src/palette.o ./src/cpu.o ./src/io.o ./src/mem.o ./src/rtc.o ./src/hw.o ./src/sound.o \
./src/events.o ./src/keytable.o \
./src/loader.o ./src/save.o ./src/debug.o ./src/emu.o ./src/main.o \
./src/rccmds.o ./src/rckeys.o ./src/rcvars.o ./src/rcfile.o ./src/exports.o \
./src/split.o ./src/path.o ./lib/gz/inflate.o $(XZ_OBJS)
INCS = -I.
MYCC = $(CC) $(CFLAGS) $(INCS) $(SYS_INCS) $(SYS_DEFS)
MYAS = $(AS) $(ASFLAGS) $(INCS) $(SYS_INCS) $(SYS_DEFS)
main.o: Version
.c.o:
$(MYCC) -c $< -o $@
.s.o:
$(MYAS) -c $< -o $@
sdl2gnuboy: $(OBJS) $(SYS_OBJS) $(SDL_OBJS)
$(LD) $(LDFLAGS) $(OBJS) $(SYS_OBJS) $(SDL_OBJS) -o $@ $(SDL_LIBS)
install: all
$(INSTALL) -d $(bindir)
$(INSTALL) -m 755 $(TARGETS) $(bindir)
clean:
rm -f *gnuboy sdl2gnuboy.exe gmon.out *.o sys/*.o lib/*/*.o sys/*/*.o $(OBJS)