Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.96 KB
/
Copy pathMakefile
File metadata and controls
65 lines (49 loc) · 1.96 KB
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
62
63
64
65
include config
VER = 1.15
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)
SOLIB = libsquish.so.$(SOVER)
LIB = $(SOLIB).0
CPPFLAGS += -fPIC
LIBA = libsquish.a
.PHONY: all install uninstall docs tgz clean
all: $(LIB) $(LIBA) docs libsquish.pc
install: $(LIB) $(LIBA) libsquish.pc
$(INSTALL_DIRECTORY) $(INSTALL_DIR)/include $(INSTALL_DIR)/$(LIB_PATH)
$(INSTALL_FILE) squish.h $(INSTALL_DIR)/include
$(INSTALL_FILE) $(LIBA) $(INSTALL_DIR)/$(LIB_PATH)
ifneq ($(USE_SHARED),0)
$(INSTALL_FILE) $(LIB) $(INSTALL_DIR)/$(LIB_PATH)
ln -s $(LIB) $(INSTALL_DIR)/$(LIB_PATH)/$(SOLIB)
ln -s $(LIB) $(INSTALL_DIR)/$(LIB_PATH)/libsquish.so
$(INSTALL_DIRECTORY) $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig
$(INSTALL_FILE) libsquish.pc $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig
endif
uninstall:
$(RM) $(INSTALL_DIR)/include/squish.h
$(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(LIBA)
-$(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(LIB)
-$(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(SOLIB)
-$(RM) $(INSTALL_DIR)/$(LIB_PATH)/libsquish.so
-$(RM) $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig/libsquish.pc
$(LIB): $(OBJ)
ifneq ($(USE_SHARED),0)
$(CXX) $(LDFLAGS) -shared -Wl,-soname,$(SOLIB) -o $@ $(OBJ)
endif
$(LIBA): $(OBJ)
$(AR) cr $@ $?
@ranlib $@
docs: $(SRC) $(HDR)
@if [ -x "`command -v doxygen`" ]; then doxygen; fi
libsquish.pc: libsquish.pc.in
@sed 's|@PREFIX@|$(PREFIX)|;s|@LIB_PATH@|$(LIB_PATH)|' $@.in > $@
tgz: clean
tar zcf libsquish-$(VER).tgz $(SRC) $(HDR) Makefile config CMakeLists.txt CMakeModules libSquish.* README.txt LICENSE.txt ChangeLog.txt Doxyfile libsquish.pc.in extra --exclude \*.svn\*
%.o: %.cpp
$(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o $@ -c $<
clean:
$(RM) $(OBJ) $(LIB) $(LIBA) libsquish.pc
@-$(RM) -rf docs