+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$(topsrcdir)/../../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$(topsrcdir)/../../include/pic16
+
+#################################################
+### linker switches
+LDFLAGS ?=
+LDFLAGS += -m -l -w
+
+#################################################
+### librarian switches
+LIBFLAGS ?=
+LIBFLAGS += -c
+
+#################################################
+### programs to use
+CPP = $(topsrcdir)/../../../bin/sdcpp
+CC = $(topsrcdir)/../../../bin/sdcc