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 ($(ARCHITECTURE), i386)
|
---|
18 | # Intel Mac
|
---|
19 |
|
---|
20 | ifeq ($(OPTIM), 1)
|
---|
21 | # MacPro
|
---|
22 | # CXXFLAGS+=-march=nocona -msse3 -DDXT_INTR
|
---|
23 |
|
---|
24 | # MacbookPro
|
---|
25 | CXXFLAGS+=-march=i686 -msse2 -DDXT_INTR
|
---|
26 |
|
---|
27 | else
|
---|
28 |
|
---|
29 | #
|
---|
30 | CXXFLAGS+=
|
---|
31 | CXXFLAGS=-g
|
---|
32 | endif
|
---|
33 |
|
---|
34 | endif
|
---|
35 |
|
---|
36 | ifeq ($(ARCHITECTURE), powerpc)
|
---|
37 | # PowerPC Mac
|
---|
38 | echo "Disabling SSE instructions on PowerPC"
|
---|
39 | CXXFLAGS+=
|
---|
40 |
|
---|
41 | endif
|
---|
42 |
|
---|
43 | else
|
---|
44 |
|
---|
45 | LDLIBS+=-lGL
|
---|
46 |
|
---|
47 | ifeq ($(ARCHITECTURE), x86_64)
|
---|
48 | # Opteron
|
---|
49 | CXXFLAGS+=-march=opteron -msse2 -DDXT_INTR
|
---|
50 |
|
---|
51 | else
|
---|
52 |
|
---|
53 | # everything considered i386/linux
|
---|
54 | CXXFLAGS+=-msse2 -DDXT_INTR
|
---|
55 |
|
---|
56 | endif
|
---|
57 |
|
---|
58 | endif
|
---|
59 |
|
---|
60 | CFLAGS=$(CXXFLAGS) `sdl-config --cflags` -I/opt/local/include
|
---|
61 |
|
---|
62 |
|
---|
63 | default: main example 2dxt viewdxt playdxt
|
---|
64 |
|
---|
65 | main: dxt.o main.o util.o intrinsic.o
|
---|
66 | example: example.o libdxt.o dxt.o util.o intrinsic.o
|
---|
67 | 2dxt: dxt.o 2dxt.o libdxt.o util.o intrinsic.o
|
---|
68 |
|
---|
69 |
|
---|
70 | viewdxt:viewdxt.o glsl.o dxt.o
|
---|
71 | ${CC} -o viewdxt viewdxt.o glsl.o dxt.o intrinsic.o `sdl-config --libs` $(LDLIBS) -lGLEW
|
---|
72 |
|
---|
73 | playdxt:playdxt.o glsl.o dxt.o
|
---|
74 | ${CC} -o playdxt playdxt.o glsl.o dxt.o intrinsic.o `sdl-config --libs` $(LDLIBS) -lGLEW
|
---|
75 |
|
---|
76 | install: default
|
---|
77 | /bin/cp -f main example 2dxt playdxt viewdxt bin
|
---|
78 |
|
---|
79 | clean:
|
---|
80 | /bin/rm -f *.o *~ main example 2dxt playdxt viewdxt *.rgba *.dxt out.*
|
---|
81 |
|
---|