File: Makefile

package info (click to toggle)
xtux 0.2-2.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,616 kB
  • ctags: 465
  • sloc: ansic: 2,921; makefile: 89
file content (80 lines) | stat: -rw-r--r-- 1,766 bytes parent folder | download
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
75
76
77
78
79
80
# XTux makefile
# David Lawrence, dmlawren@cs.adelaide.edu.au (30/APR 99)

# (Defaults)

# OPTIONS:
##############################
# If you want sound, set SOUND to 1 and uncomment SOUND_LIB
SOUND = 1
SOUND_LIB=-lesd -laudiofile
##############################

# Edited for Debian GNU/Linux.
DESTDIR =

X11_PREFIX=/usr/X11R6
INSTALLROOT=$(PWD)

CC=gcc
XTUX_BINARY=xtux
2XPM_BINARY=2xpm
X11_LIB=-L$(X11_PREFIX)/lib -lX11
MATH_LIB=-lm
XPM_LIB=-lXpm

CFLAGS=-I$(X11_PREFIX)/include -g -Wall -DUSESOUND=$(SOUND)
OBJECTS= input.o main.o map.o timing.o win.o image.o entity.o sound.o
2XPM_OBJECTS=2xpm.o

# Makefile commands: 

all:	xtux cnvtr

clean:
	@echo "Cleaning up directory."
	- rm -f *.o $(XTUX_BINARY) $(2XPM_BINARY) core *~ log errlog

# Applications:

xtux:	$(OBJECTS)
	$(CC)	$(OBJECTS) $(X11_LIB) $(XPM_LIB) $(MATH_LIB) \
		$(SOUND_LIB) \
		$(CFLAGS) -o $(XTUX_BINARY)
	chmod 755 $(XTUX_BINARY)

cnvtr:	$(2XPM_OBJECTS)
	$(CC)	$(2XPM_OBJECTS) -o $(2XPM_BINARY)
	chmod 755 $(2XPM_BINARY)

# Objects:

input.o: header.h win.h input.h input.c
	$(CC) input.c -c $(CFLAGS) -o input.o

main.o: header.h main.h win.h map.h input.h timing.h tile.h sound.h weap.h \
		main.c
	$(CC) main.c -c $(CFLAGS) -o main.o

map.o:  header.h main.h win.h tile.h map.h map.c
	$(CC)  map.c -c $(CFLAGS) -o map.o

timing.o:	header.h timing.h timing.c
	$(CC) timing.c -c $(CFLAGS) -o timing.o

win.o:  header.h main.h tile.h timing.h win.h sound.h win.c
	$(CC)  win.c -c $(CFLAGS) -o win.o

image.o: header.h main.h image.h image.c
	$(CC) image.c -c $(CFLAGS) -o image.o

entity.o:	header.h entity.h entity.c
		$(CC) entity.c -c $(CFLAGS) -o entity.o

sound.o: header.h sound.h sound.c
	$(CC) sound.c -c $(CFLAGS) -o sound.o

#bmp2xpm object

2xpm.o:	2xpm.c
	$(CC) 2xpm.c -c -o 2xpm.o