-#
-# Makefile.common - common variables makefile
-#
-# This file is part of the GNU PIC Library.
-#
-# January, 2004
-# The GNU PIC Library is maintained by,
-# Vangelis Rokas <vrokas@otenet.gr>
-#
-# $Id$
-#
-#
-
-CC = $(PRJDIR)/bin/sdcc
-CPP = $(PRJDIR)/bin/sdcpp
+###########################################################
+### Makefile.common.in for the GNU PIC Library
+###
+### Copyright (C) 2005 by Raphael Neider <rneider AT web.de>
+###
+### The GNU PIC Library was originally designed and
+### implemented by
+### Vangelis Rokas <vrokas@otenet.gr>
+###
+### It is currently maintained by
+### Raphael Neider <rneider AT web.de>
+###
+### This file may be distributed under the terms of the the
+### GNU General Public License (GPL). See COPYING for details.
+###
+### $Id$
+###
+SHELL = bash
+
+#################################################
+### verboseness
+#Q ?= # be verbose
+Q ?= @ # be quiet
+# be really quiet (suppress "Entering/Leaving directory...")
+#MAKEFLAGS := $(filter-out -s,$(MAKEFLAGS)) -s
+
+#################################################
+### compiler switches
+ARCH ?= 452 # might be overwritten in libio
+
+CFLAGS ?=
+CFLAGS += -mpic16 -p18f$(ARCH)
+CFLAGS += --std-c99
+CFLAGS += -I. -I$(top_srcdir)/../../include/pic16
+
+#################################################
+### optimization flags
+CFLAGS += --fommit-frame-pointer
+CFLAGS += --obanksel=9
+CFLAGS += --denable-peeps
+CFLAGS += --optimize-goto
+CFLAGS += --optimize-cmp
+CFLAGS += --optimize-df
+
+#################################################
+### debugging PIC16 port
+#CFLAGS += --debug-ralloc
+#CFLAGS += --debug-xtra
+#CFLAGS += --pcode-verbose
+CFLAGS += --i-code-in-asm
+
+#################################################
+### debugging SDCC's optimizations
+#CFLAGS += --nooverlay
+#CFLAGS += --nogcse
+#CFLAGS += --nolabelopt
+#CFLAGS += --noinvariant
+#CFLAGS += --noinduction
+#CFLAGS += --nojtbound
+#CFLAGS += --noloopreverse
+
+#################################################
+### assembler switches
+ASFLAGS ?=
+ASFLAGS += -pp18f$(ARCH)
+ASFLAGS += -I$(top_srcdir)/../../include/pic16
+ASFLAGS += -I$(srcdir)
+
+#################################################
+### linker switches
+LDFLAGS ?=
+LDFLAGS += -m -l -w
+
+#################################################
+### librarian switches
+LIBFLAGS ?=
+LIBFLAGS += -c
+
+#################################################
+### programs to use
+CPP = $(top_builddir)../../../bin/sdcpp
+CC = $(top_builddir)../../../bin/sdcc --asm=@GPASM@
AS = @GPASM@
LD = @GPLINK@
-AR = @GPLIB@
+LIB = @GPLIB@
+
+SED ?= @SED@
+GREP ?= @EGREP@
-RM = @RM@
-CP = @CP@
-MV = @MV@
-LS = @LS@
-SED = @SED@
+MKDIR ?= @MKDIR@
+RMDIR ?= @RMDIR@
+CP ?= @CP@
+MV ?= @MV@
+RM ?= @RM@
-MM = -MM
-MODELFLAGS = -mpic16
\ No newline at end of file