-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.sdl
74 lines (57 loc) · 2.02 KB
/
Makefile.sdl
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
CC = $(NACL_TOOLCHAIN_ROOT)/bin/nacl$(NACL_BITS)-gcc
CXX = $(NACL_TOOLCHAIN_ROOT)/bin/nacl$(NACL_BITS)-g++
LD = $(NACL_TOOLCHAIN_ROOT)/bin/nacl$(NACL_BITS)-g++
CFLAGS += -O2 -pipe -Wall -D_SDL
OBJS = main.o digger.o drawing.o sprite.o scores.o record.o sound.o \
newsnd.o ini.o input.o monster.o bags.o alpha.o vgagrafx.o \
title_gz.o icon.o sdl_kbd.o sdl_vid.o sdl_timer.o sdl_snd.o
CXXOBJS = plugin.o
ARCH = "LINUX"
#ARCH = "MINGW"
#ARCH = "FREEBSD"
#ARCH = "FooOS"
ifeq ($(ARCH),"MINGW")
CFLAGS += -mno-cygwin -DMINGW -Dmain=SDL_main -I../zlib -I../SDL-1.1.2/include/SDL
LIBS += -mno-cygwin -mwindows -lmingw32 -L../SDL-1.1.2/lib -lSDLmain -lSDL -luser32 -lgdi32 -lwinmm -L../zlib -lz
ESUFFIX = .exe
endif
ifeq ($(ARCH),"FREEBSD")
OBJS += fbsd_sup.o # strup()
CFLAGS += -DFREEBSD `sdl-config --cflags`
LIBS += `sdl-config --libs` -lz
ESUFFIX =
endif
ifeq ($(ARCH),"LINUX")
SDL_CFLAGS = `$(NACL_TOOLCHAIN_ROOT)/nacl$(NACL_BITS)/usr/bin/sdl-config --cflags`
SDL_LIBS = `$(NACL_TOOLCHAIN_ROOT)/nacl$(NACL_BITS)/usr/bin/sdl-config --libs`
OBJS += fbsd_sup.o # strup()
CFLAGS += -DLINUX $(SDL_CFLAGS)
# LIBS += -static -T ldscripts/elf64_nacl.x.static
LIBS += $(SDL_LIBS) \
-lz \
-lppapi \
-lppapi_cpp \
# -lppruntime \
# -lplatform \
# -lgio \
# -lpthread \
# -lsrpc \
# -limc \
# -limc_syscalls
ESUFFIX =
endif
ifeq ($(ARCH),"FooOS")
OBJS += # insert here the names of the files which contains various missing functions like strup() on Linux and FreeBSD
CFLAGS += -DFooOS # insert here additional compiler flags which required to find include files, trigger os-specific compiler behaviour etc.
LIBS += # insert here libs required to compile like zlib, SDL etc
ESUFFIX = # insert here suffix of the executable on your platform if any (like ".exe" on Win32)
endif
all: digger$(ESUFFIX)
digger$(ESUFFIX): $(OBJS) $(CXXOBJS)
$(LD) -o digger$(ESUFFIX) $(OBJS) $(CXXOBJS) $(LIBS)
$(OBJS): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
$(CXXOBJS): %.o: %.cc
$(CXX) -c $(CFLAGS) $< -o $@
clean:
rm -f $(OBJS) $(CXXOBJS) digger$(ESUFFIX)