diff --git a/cpu/6502/Makefile.6502 b/cpu/6502/Makefile.6502
index 717031d3e..a6464f999 100644
--- a/cpu/6502/Makefile.6502
+++ b/cpu/6502/Makefile.6502
@@ -29,23 +29,27 @@
#
# Author: Oliver Schmidt
#
-# $Id: Makefile.6502,v 1.3 2007/04/14 15:55:50 oliverschmidt Exp $
+# $Id: Makefile.6502,v 1.4 2007/04/18 22:52:22 oliverschmidt Exp $
#
#######################
# General Definitions #
#######################
+ifndef CONTIKI
+ ${error CONTIKI not defined! You must specify where CONTIKI resides!}
+endif
+
ifndef CC65_INC
- ${error CC65_INC not defined! You must specify where the cc65 headers reside}
+ ${error CC65_INC not defined! You must specify where the cc65 headers reside!}
endif
ifndef LD65_LIB
- ${error LD65_LIB not defined! You must specify where the cc65 libraries reside}
+ ${error LD65_LIB not defined! You must specify where the cc65 libraries reside!}
endif
ifndef LD65_OBJ
- ${error LD65_OBJ not defined! You must specify where the cc65 objects reside}
+ ${error LD65_OBJ not defined! You must specify where the cc65 objects reside!}
endif
AS = ca65
@@ -58,10 +62,10 @@ CFLAGS += -t $(TARGET) -Or --create-dep $(INCLUDES)
LDFLAGS = -C $(CONTIKI)/platform/$(TARGET)/linker.cfg -m $(TARGET).map
AROPTS = a
-PROJECT_OBJECTFILES += $(OBJECTDIR)/contiki-main.o
-CONTIKI_OBJECTFILES += $(OBJECTDIR)/lc-asm.o $(OBJECTDIR)/uip_arch.o
-TARGET_STARTFILES = $(TARGET).o
-TARGET_LIBFILES = $(TARGET).lib
+CONTIKI_TARGET_MAIN = $(OBJECTDIR)/contiki-main.o
+CONTIKI_OBJECTFILES += $(OBJECTDIR)/contiki-main.o $(OBJECTDIR)/lc-asm.o $(OBJECTDIR)/uip_arch.o
+TARGET_STARTFILES = $(TARGET).o --start-group
+TARGET_LIBFILES = $(TARGET).lib --end-group
#########
# Rules #