goat3d

diff Makefile @ 29:3d669155709d

- switched the unix build to use the internal vmath/anim as well - fixed a memory corruption issue which was caused by including the system-wide installed version of the anim.h header file - started the ass2goat assimp->goat3d converter
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 29 Sep 2013 21:53:03 +0300
parents b35427826b60
children 0be413ac2e0a
line diff
     1.1 --- a/Makefile	Sun Sep 29 08:46:19 2013 +0300
     1.2 +++ b/Makefile	Sun Sep 29 21:53:03 2013 +0300
     1.3 @@ -10,9 +10,11 @@
     1.4  
     1.5  openctm = libs/openctm/libopenctm.a
     1.6  tinyxml2 = libs/tinyxml2/libtinyxml2.a
     1.7 +vmath = libs/vmath/libvmath.a
     1.8 +anim = libs/anim/libanim.a
     1.9  
    1.10 -extinc = -Ilibs/openctm -Ilibs/tinyxml2
    1.11 -extlibs = $(openctm) $(tinyxml2)
    1.12 +extinc = -Ilibs/openctm -Ilibs/tinyxml2 -Ilibs/anim
    1.13 +extlibs = $(openctm) $(tinyxml2) $(anim) $(vmath)
    1.14  
    1.15  name = goat3d
    1.16  so_major = 0
    1.17 @@ -35,7 +37,7 @@
    1.18  CC = clang
    1.19  CXX = clang++
    1.20  CXXFLAGS = -pedantic -Wall $(dbg) $(opt) $(pic) $(extinc)
    1.21 -LDFLAGS = $(extlibs) -lvmath -lanim
    1.22 +LDFLAGS = $(extlibs)
    1.23  
    1.24  .PHONY: all
    1.25  all: $(lib_so) $(lib_a)
    1.26 @@ -44,7 +46,7 @@
    1.27  	$(CXX) -o $@ $(shared) $(obj) $(LDFLAGS)
    1.28  
    1.29  $(lib_a): $(obj) $(extlibs)
    1.30 -	$(AR) rcs $@ $(obj) $(openctm)
    1.31 +	$(AR) rcs $@ $(obj) $(extlibs)
    1.32  
    1.33  $(openctm):
    1.34  	$(MAKE) -C libs/openctm
    1.35 @@ -52,6 +54,12 @@
    1.36  $(tinyxml2):
    1.37  	$(MAKE) -C libs/tinyxml2
    1.38  
    1.39 +$(vmath):
    1.40 +	$(MAKE) -C libs/vmath
    1.41 +
    1.42 +$(anim):
    1.43 +	$(MAKE) -C libs/anim
    1.44 +
    1.45  -include $(dep)
    1.46  
    1.47  %.d: %.cc
    1.48 @@ -64,3 +72,26 @@
    1.49  .PHONY: cleandep
    1.50  cleandep:
    1.51  	rm -f $(dep)
    1.52 +
    1.53 +.PHONY: install
    1.54 +install: $(lib_so) $(lib_a)
    1.55 +	mkdir -p $(DESTDIR)$(PREFIX)/lib $(DESTDIR)$(PREFIX)/include
    1.56 +	cp src/goat3d.h $(DESTDIR)$(PREFIX)/include/goat3d.h
    1.57 +	cp $(lib_a) $(DESTDIR)$(PREFIX)/lib/$(lib_a)
    1.58 +	cp $(lib_so) $(DESTDIR)$(PREFIX)/lib/$(lib_so)
    1.59 +	[ -n "$(devlink)" ] && \
    1.60 +		cd $(DESTDIR)$(PREFIX)/lib && \
    1.61 +		rm -f $(soname) $(devlink) && \
    1.62 +		ln -s $(lib_so) $(soname) && \
    1.63 +		ln -s $(soname) $(devlink) || \
    1.64 +		true
    1.65 +
    1.66 +.PHONY: uninstall
    1.67 +uninstall:
    1.68 +	rm -f $(DESTDIR)$(PREFIX)/include/goat3d.h
    1.69 +	rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_so)
    1.70 +	rm -f $(DESTDIR)$(PREFIX)/lib/$(lib_a)
    1.71 +	[ -n "$(devlink)" ] && \
    1.72 +		rm -f $(DESTDIR)$(PREFIX)/lib/$(soname) && \
    1.73 +		rm -f $(DESTDIR)$(PREFIX)/lib/$(devlink) || \
    1.74 +		true