summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: f31f43f1c162a3b90ae89f7bdc233a1c90c3d22e (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
CC	 = gcc
CWARN	 = -W -Wall -Wno-pointer-sign
REQFLAGS = -D_REENTRANT -DSDL_SUBDIR
OPTFLAGS = -O2 -g
CFLAGS	 = $(CWARN) $(REQFLAGS) $(OPTFLAGS) $(INCLUDE)
LDFLAGS  =
LIBS     = -lSDL -lpthread -lm

ALL	= grv grvscored

OBJS	 = grv.o drawlevel.o play.o action.o bullets.o mystery.o \
	   prefs.o intro.o \
	   utils.o scoretbl.o highscore.o \
	   netopen.o keyboard.o graphics.o grvfont.o random.o \
	   sysrand.o homedir.o

SCORED   = grvscored.o scoretbl.o

.SUFFIXES: .c .o .i .s

all: $(ALL)

grv: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

grvscored: $(SCORED)
	$(CC) $(LDFLAGS) -o $@ $(SCORED)

.c.o:
	$(CC) $(CFLAGS) -c -o $@ $<

.c.i:
	$(CC) $(CFLAGS) -E -o $@ $<

.c.s:
	$(CC) $(CFLAGS) -S -o $@ $<

grvfont.c: grvfont.psf psftoc.pl
	$(PERL) psftoc.pl < $< > $@ || rm -f $@

clean:
	rm -f *.o *.i *.s *.exe $(ALL)

#
# To do a Win32 build on a Fedora Linux host
#
win32:
	make -f Makefile.w32 CC=i686-pc-mingw32-gcc \
		SDL=/usr/i686-pc-mingw32/sys-root/mingw