Package: simavr / 1.6+dfsg-3

build-common.patch Patch series | download
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Description: general build
 - bump ABI version number up
 - no fPIC flag for static libs
 - install on non-linux systems
Author: Milan Kupcevic <milan@debian.org>
Forwarded: not-needed
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/Makefile.common
+++ b/Makefile.common
@@ -94,8 +94,6 @@
 CFLAGS      += -I${PREFIX}/include
 LDFLAGS		+= -L/lib -L/local/lib
 CFLAGS 		+= -DNO_COLOR
-else
-CFLAGS 		+= -fPIC
 endif
 
 CPPFLAGS	+= --std=gnu99 -Wall
@@ -112,15 +110,12 @@
 
 OBJ 		:= obj-${shell $(CC) -dumpmachine}
 LIBDIR		:= ${shell pwd}/${SIMAVR}/${OBJ}
-LDFLAGS 	+= -L${LIBDIR} -lsimavr -lm
-
-LDFLAGS 	+= -lelf
+LDFLAGS 	+= -L${LIBDIR} -lsimavr
 
 ifeq (${WIN}, Msys)
 LDFLAGS      += -lws2_32
 endif
 
-ifeq (${shell uname}, Linux)
 ifeq ($(RELEASE),1)
 # allow the shared library to be found in the build directory
 # only for linking, the install time location is used at runtime
@@ -129,13 +124,8 @@
 # allow the shared library to be found in the build directory
 LFLAGS		+= -Wl,-rpath,${LIBDIR}
 endif
-endif
 
-ifeq (${V}, 1)
 E		=
-else
-E		= @
-endif
 
 # The code is compiled "optimized" to the max.
 #
@@ -165,21 +155,24 @@
 	@${AVR}size ${@}|sed '1d'
 
 # this rule has precedence
-${OBJ}/sim_%.o : cores/sim_%.c
-ifneq ($(E),)
-	@echo CORE $<
-endif
+${OBJ}/sim_%.sto : cores/sim_%.c
 	${E}$(CC) $(CPPFLAGS) $(CFLAGS) $(CORE_CFLAGS) -MMD \
 		${AVR_CPPFLAGS} \
 		$<  -c -o $@
 
-${OBJ}/%.o: %.c
-ifneq ($(E),)
-	@echo CC $<
-endif
+${OBJ}/sim_%.o : cores/sim_%.c
+	${E}$(CC) $(CPPFLAGS) $(CFLAGS) $(CORE_CFLAGS) -MMD \
+		${AVR_CPPFLAGS} -fPIC \
+		$<  -c -o $@
+
+${OBJ}/%.sto: %.c
 	${E}$(CC) $(CPPFLAGS) $(CFLAGS) -MMD \
 		$<  -c -o $@
 
+${OBJ}/%.o: %.c
+	${E}$(CC) $(CPPFLAGS) $(CFLAGS) -MMD -fPIC \
+		$<  -c -o $@
+
 ${OBJ}/%.elf:
 ifneq ($(E),)
 	@echo LD $@
@@ -187,7 +180,7 @@
 	${E}$(CC) -MMD ${CFLAGS}  ${LFLAGS} -o $@ ${filter %.o,$^} $(LDFLAGS)
 
 
-.PRECIOUS: ${OBJ}/%.a ${OBJ}/%.so.1
+.PRECIOUS: ${OBJ}/%.a ${OBJ}/%.so.2
 #
 # Static library
 #
@@ -195,23 +188,7 @@
 ifneq ($(E),)
 	@echo AR $@
 endif
-	${E}$(AR) cru $@ ${filter %.o,$^} && $(RANLIB) $@
-
-#
-# Shared library (Linux)
-#
-${OBJ}/%.so.1: ${OBJ}/%.a
-ifneq ($(E),)
-	@echo SHARED $@
-endif
-	${E}$(CC) -o $@ -shared \
-		-Wl,--whole-archive,-soname,${basename ${notdir $@}}.1 \
-		${filter %.o %.a,$^} \
-		 -Wl,--no-whole-archive \
-		${filter-out -l%, $(LDFLAGS)} ${EXTRA_LDFLAGS}
-
-${OBJ}/%.so: ${OBJ}/%.so.1
-	ln -sf ${notdir $<} $@
+	${E}$(AR) cr $@ ${filter %.sto,$^} && $(RANLIB) $@
 
 obj: ${OBJ}
 
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@
 
 .PHONY: doc
 
-all:	build-simavr build-tests build-examples build-parts
+all:	build-simavr build-tests build-parts
 
 build-simavr:
 	$(MAKE) -C simavr RELEASE=$(RELEASE)
@@ -20,7 +20,7 @@
 build-examples: build-simavr
 	$(MAKE) -C examples RELEASE=$(RELEASE)
 
-build-parts: build-examples
+build-parts: build-simavr
 	$(MAKE) -C examples/parts RELEASE=$(RELEASE)
 
 install:
@@ -29,9 +29,6 @@
 doc:
 	$(MAKE) -C doc RELEASE=$(RELEASE)
 
-install:
-	$(MAKE) -C simavr install
-
 clean:
 	$(MAKE) -C simavr clean
 	$(MAKE) -C tests clean