File: Makefile.w32

package info (click to toggle)
icebreaker 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 868 kB
  • sloc: ansic: 6,119; makefile: 176; xml: 32; sh: 11
file content (45 lines) | stat: -rw-r--r-- 1,232 bytes parent folder | download | duplicates (2)
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
# standard path for mingw32 cross compiler
# see <http://www.libsdl.org/extras/win32/cross/README.txt>
CROSSTOOLSPATH=/usr/$(WINARCH)-w64-mingw32
MINGW32BIN=$(CROSSTOOLSPATH)/bin

CC=$(WINARCH)-w64-mingw32-gcc
WINDRES=$(WINARCH)-w64-mingw32-windres

SDLCONFIG=$(CROSSTOOLSPATH)/sys-root/mingw/bin/sdl-config

ifndef OPTIMIZE
  OPTIMIZE=-O2
endif

CFLAGS=-Wall -Werror -Wno-error=pointer-sign $(OPTIMIZE) $(SDL_CFLAGS) -DDATAPREFIX=\".\" -DHISCOREPREFIX=\".\" -DWIN32 -fstack-protector

SRC=icebreaker.c cursor.c grid.c laundry.c line.c penguin.c sound.c \
    level.c intro.c text.c status.c transition.c hiscore.c dialog.c \
    menu.c options.c fullscreen.c themes.c event.c titlebar.c benchmark.c \
    misc.c lock.c delay.c \
    win32_compatibility.c

RES=win32_resources.rc

SDL_MIXER=-lSDL_mixer
SDL_LIB=$(SDL_LDFLAGS) $(SDL_MIXER) 
SDL_CFLAGS := $(shell $(SDLCONFIG) --cflags)
SDL_LDFLAGS := $(shell $(SDLCONFIG) --libs)


all:	icebreaker.exe

%.d: %.c
	set -e; $(CC) -M $(CFLAGS) $< \
           | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
           [ -s $@ ] || rm -f $@

%.o:%.rc
	$(WINDRES) $< $(subst .rc,.o,$<)

icebreaker.exe:	$(SRC:.c=.o) $(RES:.rc=.o)
	$(CC) $(CFLAGS) $^ -o $@ $(SDL_LIB)


include $(SRC:.c=.d)