File: makefile.patch

package info (click to toggle)
bulletml 0.0.6-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 928 kB
  • sloc: cpp: 7,706; xml: 810; perl: 184; makefile: 129; yacc: 125
file content (63 lines) | stat: -rw-r--r-- 1,871 bytes parent folder | download | duplicates (3)
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
# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
# Distributed under the same license as the original software. See debian/copyright.

Index: bulletml-0.0.6/src/Makefile
===================================================================
--- bulletml-0.0.6.orig/src/Makefile
+++ bulletml-0.0.6/src/Makefile
@@ -1,27 +1,46 @@
-CC = g++
-INCLUDES = -I.
-LIBS = tinyxml/tinyxml.o tinyxml/tinyxmlparser.o tinyxml/tinyxmlerror.o
 #CXXFLAGS = -g -W -Wall -ansi -pedantic
 #CXXFLAGS = -pg -g -W -Wall -ansi -pedantic
+#CXXFLAGS = -O2 -W -Wall -ansi -pedantic -I. -I../d_cpp
 CXXFLAGS = -O2 -W -Wall -ansi -pedantic
 CFLAGS = -O2
-OBJS = bulletmlparser-tinyxml.o bulletmlparser.o bulletmltree.o calc.o formula-variables.o bulletmlrunner.o bulletmlrunnerimpl.o
+LDFLAGS=
+INCLUDES= -I. -I../d_cpp
+OBJS = bulletmlparser-tinyxml.o bulletmlparser.o bulletmltree.o calc.o \
+	formula-variables.o bulletmlrunner.o bulletmlrunnerimpl.o bulletml_d.o
+
+MAJOR=0d2
+MINOR=0
+
+all: libbulletml.a libbulletml.so
+
+libbulletml.so: tinyxml/tinyxml.o ../bulletml.d $(OBJS)
+	$(CXX) $(LDFLAGS) -shared \
+		-Wl,-soname,$@.$(MAJOR) \
+		-o $@.$(MAJOR).$(MINOR) \
+		*.o tinyxml/tiny*.o
+	rm -f $@.$(MAJOR)
+	ln -s $@.$(MAJOR).$(MINOR) $@.$(MAJOR)
+	rm -f $@
+	ln -s $@.$(MAJOR) $@
 
-all: libbulletml.a
+libbulletml.a: tinyxml/tinyxml.o ../bulletml.d $(OBJS)
+	LC_ALL=C ar cru $@ *.o tinyxml/tiny*.o
 
-libbulletml.a: $(OBJS)
+../bulletml.d: bulletml_d.cpp
+	perl ../d_cpp/create_d_import.pl bulletml_d.cpp bulletml.d
+
+tinyxml/tinyxml.o:
 	$(MAKE) -C tinyxml
-	$(AR) -r libbulletml.a *.o tinyxml/tiny*.o
 
 clean:
-	rm -f *.o *.a
+	rm -f *.o *.a test_bulletml *.so *.so.*
 	$(MAKE) -C tinyxml clean
 
 calc.cpp: calc.yy
 	bison -y   calc.yy && mv y.tab.c calc.cpp
 
 $(OBJS): %.o: %.cpp
-	$(CC) -c $(CXXFLAGS) $(INCLUDES) $<
+	$(CXX) -c $(CXXFLAGS) $(INCLUDES) $<
 
 doxy:
 	doxygen