2007-09-11 14:12:59 +02:00
|
|
|
#
|
|
|
|
# Makefile for PC-6001 using z80/SDCC
|
|
|
|
# @author Takahide Matsutsuka <markn@markn.org>
|
|
|
|
#
|
2007-11-28 11:11:55 +01:00
|
|
|
# $Id: Makefile.pc-6001,v 1.7 2007/11/28 10:11:55 matsutsuka Exp $
|
2007-09-11 14:12:59 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
ifndef CONTIKI
|
|
|
|
$(error CONTIKI not defined! You must specify where CONTIKI resides!)
|
|
|
|
endif
|
|
|
|
|
2007-11-28 10:43:01 +01:00
|
|
|
# Default values
|
|
|
|
ARCH=PC6001
|
|
|
|
MEMORY=32K
|
|
|
|
PLATFORM_APPS=$(PLATFORM_APPS_DESKTOP)
|
|
|
|
CONTIKI_TARGET_MAIN = contiki-main.c
|
|
|
|
CTKCONF = NORMAL
|
|
|
|
LOADER = 0
|
|
|
|
|
|
|
|
# Target dependent options
|
|
|
|
ifeq ($(MAKECMDGOALS),p62)
|
|
|
|
ARCH=PC6001MK2
|
|
|
|
else ifeq ($(MAKECMDGOALS),p6A)
|
|
|
|
ARCH=PC6001A
|
|
|
|
else ifeq ($(MAKECMDGOALS),minimal)
|
|
|
|
MEMORY=16K
|
|
|
|
CONTIKI_TARGET_MAIN=contiki-minimal-main.c
|
|
|
|
else ifeq ($(MAKECMDGOALS),serial)
|
|
|
|
CONTIKI_TARGET_MAIN=contiki-serial-main.c
|
|
|
|
else ifeq ($(MAKECMDGOALS),rom)
|
|
|
|
CTKCONF=NOICON
|
|
|
|
MEMORY=ROM
|
|
|
|
LOADER = 1
|
|
|
|
CONTIKI_TARGET_MAIN=contiki-loader-main.c
|
|
|
|
else ifeq ($(MAKECMDGOALS),load)
|
|
|
|
CTKCONF=NOICON
|
|
|
|
LOADER = 1
|
|
|
|
CONTIKI_TARGET_MAIN=contiki-loader-main.c
|
|
|
|
else ifeq ($(MAKECMDGOALS),server)
|
2007-11-28 11:03:40 +01:00
|
|
|
CTKCONF=SERVER
|
2007-11-28 11:11:55 +01:00
|
|
|
PLATFORM_APPS = $(PLATFORM_APPS_NETWORK)
|
2007-11-28 10:43:01 +01:00
|
|
|
CONTIKI_TARGET_MAIN=contiki-server-main.c
|
|
|
|
else ifeq ($(MAKECMDGOALS),client)
|
|
|
|
CTKCONF=CLIENT
|
2007-11-28 11:11:55 +01:00
|
|
|
PLATFORM_APPS = $(PLATFORM_APPS_NETWORK)
|
2007-11-28 10:43:01 +01:00
|
|
|
CONTIKI_TARGET_MAIN=contiki-client-main.c
|
2007-09-11 14:12:59 +02:00
|
|
|
endif
|
2007-11-28 10:43:01 +01:00
|
|
|
|
|
|
|
### setup default values
|
|
|
|
ifndef HEX2BIN
|
|
|
|
HEX2BIN = hex2cas
|
2007-09-11 14:12:59 +02:00
|
|
|
endif
|
|
|
|
|
2007-11-28 10:43:01 +01:00
|
|
|
### setup flags to be used in compiler, assembler, and HEX2BIN
|
2007-09-11 14:12:59 +02:00
|
|
|
PLATFORM = $(CONTIKI)/platform/$(TARGET)
|
|
|
|
CONTIKI_TARGET_DIRS = . ctk dev loader
|
2007-11-28 10:43:01 +01:00
|
|
|
CFLAGS += -DMEMORY_$(MEMORY) -DARCH_$(ARCH) -DCTK_$(CTKCONF)
|
|
|
|
#-Wp-includecontiki-conf.h
|
|
|
|
|
2007-09-11 14:12:59 +02:00
|
|
|
ifeq ($(MEMORY),16K)
|
2007-09-29 06:07:00 +02:00
|
|
|
LDFLAGS += --code-loc 0xc40f --data-loc 0
|
2007-11-28 10:43:01 +01:00
|
|
|
HEX2BINFLAGS = -1 -n contki -o contiki.p6
|
2007-09-11 14:12:59 +02:00
|
|
|
else ifeq ($(MEMORY),ROM)
|
|
|
|
LDFLAGS += --code-loc 0x4004 --data-loc 0xf000
|
2007-11-28 10:43:01 +01:00
|
|
|
HEX2BINFLAGS = -r -o contiki.rom
|
2007-09-11 14:55:35 +02:00
|
|
|
else ifeq ($(ARCH),PC6001MK2)
|
2007-09-29 06:07:00 +02:00
|
|
|
LDFLAGS += --code-loc 0x800f --data-loc 0
|
2007-11-28 10:43:01 +01:00
|
|
|
HEX2BINFLAGS = -5 -o contiki2.p6
|
2007-09-11 14:12:59 +02:00
|
|
|
else
|
2007-09-29 06:07:00 +02:00
|
|
|
LDFLAGS += --code-loc 0x840f --data-loc 0
|
2007-11-28 10:43:01 +01:00
|
|
|
HEX2BINFLAGS = -2 -n contki -o contiki.p6
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(LOADER),1)
|
|
|
|
CFLAGS += -DWITH_LOADER_ARCH=1
|
2007-09-11 14:12:59 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
### Include platform-depend application makefiles
|
|
|
|
|
|
|
|
ifdef PLATFORM_APPS
|
|
|
|
PLATFORM_APPDIRS += ${addprefix $(PLATFORM)/apps/, $(PLATFORM_APPS)}
|
|
|
|
PLATFORM_APPINCLUDES = ${foreach APP, $(PLATFORM_APPS), $(PLATFORM)/apps/$(APP)/Makefile.$(APP)}
|
|
|
|
-include $(PLATFORM_APPINCLUDES)
|
|
|
|
PLATFORM_APP_SOURCES = ${foreach APP, $(PLATFORM_APPS), $($(APP)_src)}
|
|
|
|
PLATFORM_DSC_SOURCES = ${foreach APP, $(PLATFORM_APPS), $($(APP)_dsc)}
|
|
|
|
CONTIKI_SOURCEFILES += $(PLATFORM_APP_SOURCES) $(PLATFORM_DSC_SOURCES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
CONTIKI_TARGET_SOURCEFILES = \
|
|
|
|
$(CTK) cfs-ram.c serial.c slip.c \
|
2007-11-28 10:43:01 +01:00
|
|
|
resolv.c loader_arch.c \
|
2007-09-29 06:07:00 +02:00
|
|
|
ctk-conio_arch.c $(CONTIKI_TARGET_MAIN)
|
2007-09-11 14:12:59 +02:00
|
|
|
|
2007-09-29 06:07:00 +02:00
|
|
|
#you can use the below instead of ctk-conio_arch.c, ctk-conio_arch-asm.cS,
|
|
|
|
# and libconio_arch-asm.cS
|
2007-09-11 14:12:59 +02:00
|
|
|
#ctk-conio_arch-source.c
|
|
|
|
|
|
|
|
CONTIKI_ASMFILES += getkey.S isprint_arch.S clock.S rs232-asm.S
|
2007-11-28 10:43:01 +01:00
|
|
|
CONTIKI_CASMFILES += ctk-conio_arch-asm.cS libconio_arch-asm.cS\
|
|
|
|
libconio_arch-small.cS
|
2007-09-11 14:12:59 +02:00
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
2007-09-29 06:07:00 +02:00
|
|
|
CLEAN += *.rom *.p6 *.asm
|
2007-09-11 14:12:59 +02:00
|
|
|
|
2007-09-11 14:55:35 +02:00
|
|
|
contiki: contiki.p6
|
2007-09-11 14:12:59 +02:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
2007-09-29 06:07:00 +02:00
|
|
|
%.p6: %.ihx
|
2007-11-28 10:43:01 +01:00
|
|
|
$(HEX2BIN) $(HEX2BINFLAGS) $<
|
2007-09-29 06:07:00 +02:00
|
|
|
%.rom: %.ihx
|
2007-11-28 10:43:01 +01:00
|
|
|
$(HEX2BIN) $(HEX2BINFLAGS) $<
|
2007-09-11 14:12:59 +02:00
|
|
|
|
|
|
|
remove-ctk:
|
|
|
|
rm -f obj_$(TARGET)/ctk*;
|
|
|
|
rm -f contiki.ihex
|
|
|
|
remove-net:
|
|
|
|
rm -f ${addprefix obj_$(TARGET)/,uip*.o hc.o psock.o rawpacket-udp.o resolv.o slip*.o tcp*.o uaod*.o rime*.o http*.o web*.o};
|
|
|
|
rm -f contiki.ihex
|
|
|
|
remove-mt:
|
|
|
|
rm -f obj_$(TARGET)/mt*.o
|
|
|
|
rm -f contiki.ihex
|
|
|
|
|
|
|
|
### Define the CPU directory
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/z80
|
|
|
|
include $(CONTIKI_CPU)/Makefile.z80
|
|
|
|
|
|
|
|
### Setup directory search path for source files
|
|
|
|
PROJECTDIRS += $(PLATFORM_APPDIRS)
|
|
|
|
|