1# Makefile for explosions
2
3# by Bill Kendrick
4# bill@newbreedsoftware.com
5# http://www.newbreedsoftware.com/bill/
6
7# July 30, 2001 - July 31, 2001
8
9
10# CFLAGS to send to compiler:
11# -Wall = Show all warnings
12# -O2 = Optimize
13# $(SDL_FLAGS) = Attaches compiler flags needed for libSDL
14
15CFLAGS+=-Wall $(SDL_CFLAGS)
16
17
18# Call "/usr/local/bin/sdl-config" program to get compiler flags needed for libSDL
19
20SDL_CFLAGS := $(shell /usr/local/bin/sdl-config --cflags)
21
22
23# Call "/usr/local/bin/sdl-config" program to get linker flags needed to link with libSDL
24
25SDL_LDFLAGS := $(shell /usr/local/bin/sdl-config --libs)
26
27
28# All flags needed to link with libSDL and related libraries:
29# $(SDL_LDFLAGS) = Attaches linker flags needed for libSDL
30# -lSDL_image = Attaches linker flag needed for SDL_image (used for PNG support)
31
32SDL_LIB=$(SDL_LDFLAGS) -lSDL_image
33
34
35
36# Makefile 'commands':
37
38# Build and strip the executable:
39
40all:	explosions
41	strip explosions
42
43
44# Remove the executable and ".o" object files:
45
46clean:
47	-rm *.o
48	-rm explosions
49
50
51# The executable:
52
53explosions:	explosions.o
54	$(CC) $(CFLAGS)	explosions.o -o explosions $(SDL_LIB) -lm
55
56
57
58# The executable's ".o" object file:
59
60explosions.o:	explosions.c
61