summaryrefslogtreecommitdiff
path: root/Makefile
blob: 08cc77458c24c834df4c3f4652b51a1c7cbc30f6 (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
50
51
52
53
54
55
56
57
58
59
60
61
CC = gcc
NASM = nasm

CFLAGS = -g -Wall -Iinclude -Iwin95 -Iavp -Iavp/win95 -Iavp/support -Iavp/win95/frontend
LDLIBS = -lm # /home/relnev/ElectricFence-2.2.2/libefence.a

CFLAGS += `sdl-config --cflags`
LDLIBS += `sdl-config --libs`

AFLAGS = -g -Iinclude/ -w+macro-params -w+orphan-labels -w+number-overflow

ROOT = afont.c frustum.c kshape.c map.c maths.c mem3dc.c mem3dcpp.cpp module.c morph.c mslhand.c object.c shpanim.c sphere.c tables.c vdb.c version.c

# the following should really be autogenerated...

SRCNAMES =	$(addprefix $(2)/,$(1))
OBJNAMES =	$(addprefix $(2)/,$(addsuffix .o,$(basename $(1))))
OBJNAMES1 =	$(addsuffix .o,$(basename $(1)))

ROOTSRC =	$(ROOT)
ROOTOBJ =	$(call OBJNAMES1,$(ROOT))


SRC = $(ROOTSRC)
OBJ = $(ROOTOBJ)

.SUFFIXES: .asm

all: avp

avp: depend $(OBJ)
	gcc -o avp $(OBJ) $(LDLIBS)

compile: $(OBJ)

.asm.o:
	$(NASM) $(AFLAGS) -f elf -o $@ $<

tester:
	echo $(OBJ)

clean:
	-rm -rf depend $(OBJ)

distclean: clean
	-rm -rf `find . -name "*~"`

# I wish I knew how to do dependencies correctly...

#depend: Makefile $(SRC)
#	$(CC) $(CFLAGS) -MM $(SRC) > depend

# insert makefile dependencies here
# -include depend

depend: Makefile # $(SRC)
	touch depend
	makedepend -fdepend -- $(CFLAGS) -- $(SRC)

-include depend
# DO NOT DELETE THIS LINE -- make depend depends on it.