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
