-
Notifications
You must be signed in to change notification settings - Fork 1
/
GNUmakefile
46 lines (34 loc) · 1.04 KB
/
GNUmakefile
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
include config
VER = 1.13
SOVER = 0
SRC = alpha.cpp clusterfit.cpp colourblock.cpp colourfit.cpp colourset.cpp maths.cpp rangefit.cpp singlecolourfit.cpp squish.cpp
HDR = alpha.h clusterfit.h colourblock.h colourfit.h colourset.h maths.h rangefit.h singlecolourfit.h squish.h
HDR += config.h simd.h simd_float.h simd_sse.h simd_ve.h singlecolourlookup.inl
OBJ = $(SRC:%.cpp=%.o)
ifeq ($(USE_SHARED),1)
SOLIB = libsquish.so.$(SOVER)
LIB = $(SOLIB).0
CPPFLAGS += -fPIC
else
LIB = libsquish.a
endif
all: $(LIB)
install: $(LIB)
install squish.h $(INSTALL_DIR)/include
install $(LIB) $(INSTALL_DIR)/lib
uninstall:
$(RM) $(INSTALL_DIR)/include/squish.h
$(RM) $(INSTALL_DIR)/lib/$(LIB)
$(LIB): $(OBJ)
ifeq ($(USE_SHARED),1)
$(CXX) -shared -Wl,-soname,$(SOLIB) -o $@ $(OBJ)
else
$(AR) cr $@ $?
ranlib $@
endif
tgz: clean
tar zcf libsquish-$(VER).tgz $(SRC) $(HDR) GNUmakefile config CMakeLists.txt libsquish.pro sources.pro README ChangeLog Doxyfile
%.o: %.cpp
$(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o $@ -c $<
clean:
$(RM) $(OBJ) $(LIB) Makefile