Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. include config
  2. VER = 1.15
  3. SOVER = 0
  4. SRC = alpha.cpp clusterfit.cpp colourblock.cpp colourfit.cpp colourset.cpp maths.cpp rangefit.cpp singlecolourfit.cpp squish.cpp
  5. HDR = alpha.h clusterfit.h colourblock.h colourfit.h colourset.h maths.h rangefit.h singlecolourfit.h squish.h
  6. HDR += config.h simd.h simd_float.h simd_sse.h simd_ve.h singlecolourlookup.inl
  7. OBJ = $(SRC:%.cpp=%.o)
  8. SOLIB = libsquish.so.$(SOVER)
  9. LIB = $(SOLIB).0
  10. CPPFLAGS += -fPIC
  11. LIBA = libsquish.a
  12. .PHONY: all install uninstall docs tgz clean
  13. all: $(LIB) $(LIBA) docs libsquish.pc
  14. install: $(LIB) $(LIBA) libsquish.pc
  15. $(INSTALL_DIRECTORY) $(INSTALL_DIR)/include $(INSTALL_DIR)/$(LIB_PATH)
  16. $(INSTALL_FILE) squish.h $(INSTALL_DIR)/include
  17. $(INSTALL_FILE) $(LIBA) $(INSTALL_DIR)/$(LIB_PATH)
  18. ifneq ($(USE_SHARED),0)
  19. $(INSTALL_FILE) $(LIB) $(INSTALL_DIR)/$(LIB_PATH)
  20. ln -s $(LIB) $(INSTALL_DIR)/$(LIB_PATH)/$(SOLIB)
  21. ln -s $(LIB) $(INSTALL_DIR)/$(LIB_PATH)/libsquish.so
  22. $(INSTALL_DIRECTORY) $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig
  23. $(INSTALL_FILE) libsquish.pc $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig
  24. endif
  25. uninstall:
  26. $(RM) $(INSTALL_DIR)/include/squish.h
  27. $(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(LIBA)
  28. -$(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(LIB)
  29. -$(RM) $(INSTALL_DIR)/$(LIB_PATH)/$(SOLIB)
  30. -$(RM) $(INSTALL_DIR)/$(LIB_PATH)/libsquish.so
  31. -$(RM) $(INSTALL_DIR)/$(LIB_PATH)/pkgconfig/libsquish.pc
  32. $(LIB): $(OBJ)
  33. ifneq ($(USE_SHARED),0)
  34. $(CXX) $(LDFLAGS) -shared -Wl,-soname,$(SOLIB) -o $@ $(OBJ)
  35. endif
  36. $(LIBA): $(OBJ)
  37. $(AR) cr $@ $?
  38. @ranlib $@
  39. docs: $(SRC) $(HDR)
  40. @if [ -x "`command -v doxygen`" ]; then doxygen; fi
  41. libsquish.pc: libsquish.pc.in
  42. @sed 's|@PREFIX@|$(PREFIX)|;s|@LIB_PATH@|$(LIB_PATH)|' $@.in > $@
  43. tgz: clean
  44. 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\*
  45. %.o: %.cpp
  46. $(CXX) $(CPPFLAGS) -I. $(CXXFLAGS) -o $@ -c $<
  47. clean:
  48. $(RM) $(OBJ) $(LIB) $(LIBA) libsquish.pc
  49. @-$(RM) -rf docs