summaryrefslogtreecommitdiffstats
path: root/mufhd0/Makefile
blob: 5d86371f72c437960e2b083e87ec5324f8a8d1b7 (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
# why not autoconf/automake here?
# i love simplicity
# i'm still looking for a simple person loving me!

CC = gcc
CPP = g++
INSTALL = install -c
PREFIX = /usr/local
DATADIR = $(PREFIX)/share/mufhd0

#debug flags
#CFLAGS = -pipe -ggdb \
#         -DDATADIR=\"$(DATADIR)\"

# very shamanic lubrifications
#         -fno-inline -fno-loop-optimize -fexpensive-optimizations -fpeephole2

CFLAGS = -fPIC -pipe -Wall -O2 -ffast-math -fomit-frame-pointer -DDATADIR=\"$(DATADIR)\"

# choose your compilation architecture
CFLAGS += -DARCH_X86
CFLAGS += -DHAVE_MMX
#CFLAGS += -DARCH_PPC
CFLAGS += -DHAVE_64BIT






INCLUDE = -I. `sdl-config --cflags` \
          `pkg-config --cflags libpng12` \
          `libmikmod-config --cflags`

LIBS = `sdl-config --libs` \
       `pkg-config --libs libpng12` \
       `libmikmod-config --libs`

all: mufhd0 water.so

mufhd0: mufhd0.o water.o fixsin.o
	$(CPP) -o mufhd0 fixsin.o water.o mufhd0.o $(LIBS)

water.so: water.o
	ld -E -z now -shared water.o -o water.so

%.o: %.cpp
	$(CPP) $(INCLUDE) $(CFLAGS) -c -o $@ $<

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

install: all
	$(INSTALL) -s mufhd0 $(PREFIX)/bin
	$(INSTALL) data/* $(DATADIR)

clean:
	rm -f mufhd0 *.o *.so