Skip to content

Instantly share code, notes, and snippets.

@adriweb
Last active January 28, 2016 02:50
Show Gist options
  • Save adriweb/cef66514c70083cfde63 to your computer and use it in GitHub Desktop.
Save adriweb/cef66514c70083cfde63 to your computer and use it in GitHub Desktop.
CEDEV ?= ..\..\modules\native_eZ80\internal\toolchain
BIN = $(CEDEV)\bin
INCLUDE = $(CEDEV)\include
WORKDIR ?= .
OUTDIR ?= .
TARGET ?= CPRGMCE
CC = @$(BIN)\eZ80cc
AS = @$(BIN)\eZ80asm
LD = @$(BIN)\eZ80link
AR = @$(BIN)\eZ80lib
CV = @$(BIN)\convhex
SOURCES = $(wildcard *.c)
OBJECTS = $(SOURCES:.c=.obj)
OBJECTSLD = $(SOURCES:.c=.obj, )
HEADERS = ".;$(CEDEV)\include\ce;$(CEDEV)\include\;$(CEDEV)\include\std"
LIBRARIES = "$(CEDEV)\lib\std\chelp.lib,$(CEDEV)\lib\std\crt.lib,$(CEDEV)\lib\std\crtS.lib,$(CEDEV)\lib\std\nokernel.lib,$(CEDEV)\lib\std\fplib.lib,$(CEDEV)\lib\std\fplibS.lib"
COMMON_ASM_FLAGS = \
-define:_EZ80=1 -define:_SIMULATE=1 -include:$(HEADERS) -NOlist -NOlistmac \
-pagelen:56 -pagewidth:80 -quiet -sdiopt -warn -NOdebug -NOigcase -cpu:eZ80190
CFLAGS = \
-quiet -define:NDEBUG -define:_EZ80190 -define:_EZ80 -define:_SIMULATE -genprintf -keeplst -NOlistinc \
-NOmodsect -cpu:eZ80190 -keepasm -optspeed -NOreduceopt -stdinc:$(HEADERS) -usrinc:"." -NOdebug \
-asmsw:"$(COMMON_ASM_FLAGS)"
ASFLAGS = -name $(COMMON_ASM_FLAGS)
LDFLAGS = @.\Linkcmd
LDFLAGS += $(TARGET)= $(OBJECTSLD) $(LIBRARIES)
LDFLAGS += GROUP MEMORY = ROM, RAM
all : $(TARGET)
%.obj : %.c
$(CC) $(CFLAGS) $<
$(TARGET) : $(OBJECTS)
$(LD) $(LDFLAGS)
# $(CV) $(TARGET)
install: all
copy $(TARGET).hex $(OUTDIR)\$(TARGET).hex
clean:
del /F /Q *.hex *.src *.hex *.map *.obj $(OUTDIR)\* >nul 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment