1 | CC=g++
|
---|
2 | CXX=g++
|
---|
3 | LDFLAGS=-O3
|
---|
4 | LDLIBS=-lpthread
|
---|
5 | CXXFLAGS=-O3 -funroll-loops -fomit-frame-pointer
|
---|
6 |
|
---|
7 | OPTIM=1
|
---|
8 |
|
---|
9 | MACHINE=$(shell uname -s)
|
---|
10 | ARCHITECTURE=$(shell uname -p)
|
---|
11 |
|
---|
12 | ifeq ($(MACHINE), Darwin)
|
---|
13 |
|
---|
14 | CXXFLAGS+=-I/opt/local/include
|
---|
15 | LDLIBS+=-framework OpenGL
|
---|
16 |
|
---|
17 | ifeq ($(OPTIM), 1)
|
---|
18 | # MacPro
|
---|
19 | # CXXFLAGS+=-march=nocona -msse3 -DDXT_INTR
|
---|
20 |
|
---|
21 | # MacbookPro
|
---|
22 | #CXXFLAGS+=-march=i686 -msse2 -DDXT_INTR
|
---|
23 | CXXFLAGS+=-m32
|
---|
24 | LDFLAGS+=-m32
|
---|
25 |
|
---|
26 | endif
|
---|
27 |
|
---|
28 | ifeq ($(ARCHITECTURE), powerpc)
|
---|
29 | # PowerPC Mac
|
---|
30 | echo "Disabling SSE instructions on PowerPC"
|
---|
31 | CXXFLAGS+=
|
---|
32 |
|
---|
33 | endif
|
---|
34 |
|
---|
35 | else
|
---|
36 |
|
---|
37 | LDLIBS+=-lGL
|
---|
38 |
|
---|
39 | ifeq ($(ARCHITECTURE), x86_64)
|
---|
40 | # Opteron
|
---|
41 | CXXFLAGS+=-march=opteron -msse2 -DDXT_INTR
|
---|
42 |
|
---|
43 | else
|
---|
44 |
|
---|
45 | # everything considered i386/linux
|
---|
46 | CXXFLAGS+=-msse2 -DDXT_INTR
|
---|
47 |
|
---|
48 | endif
|
---|
49 |
|
---|
50 | endif
|
---|
51 |
|
---|
52 | CFLAGS=$(CXXFLAGS) `sdl-config --cflags` -I/opt/local/include
|
---|
53 |
|
---|
54 |
|
---|
55 | default: main example 2dxt viewdxt playdxt
|
---|
56 |
|
---|
57 | main: dxt.o main.o util.o intrinsic.o
|
---|
58 | example: example.o libdxt.o dxt.o util.o intrinsic.o
|
---|
59 | 2dxt: dxt.o 2dxt.o libdxt.o util.o intrinsic.o
|
---|
60 |
|
---|
61 |
|
---|
62 | viewdxt:viewdxt.o glsl.o dxt.o
|
---|
63 | ${CC} ${LDFLAGS} -o viewdxt viewdxt.o glsl.o dxt.o intrinsic.o `sdl-config --libs` $(LDLIBS) -lGLEW
|
---|
64 |
|
---|
65 | playdxt:playdxt.o glsl.o dxt.o
|
---|
66 | ${CC} ${LDFLAGS} -o playdxt playdxt.o glsl.o dxt.o intrinsic.o `sdl-config --libs` $(LDLIBS) -lGLEW
|
---|
67 |
|
---|
68 | install: default
|
---|
69 | /bin/cp -f main example 2dxt playdxt viewdxt bin
|
---|
70 |
|
---|
71 | clean:
|
---|
72 | /bin/rm -f *.o *~ main example 2dxt playdxt viewdxt *.rgba *.dxt out.*
|
---|
73 |
|
---|