Codebase list icebreaker / scrub-obsolete/main Makefile.w32
scrub-obsolete/main

Tree @scrub-obsolete/main (Download .tar.gz)

Makefile.w32 @scrub-obsolete/mainraw · history · blame

# 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)