-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (31 loc) · 832 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
SRCS = M4ROM.s
PROJ_NAME = M4ROM
AS:=sdasz80
CC:=sdcc
LD:=sdcc
HEXBIN?=./hex2bin.exe
OBJS = $(SRCS:.s=.rel)
.SUFFIXES: .c .s
all: $(PROJ_NAME).BIN
$(PROJ_NAME).BIN: #$(OBJS)
$(AS) -o $(SRCS:.s=.rel) $(SRCS)
$(CC) -o $(SRCS:.s=.ihx) --no-std-crt0 -mz80 --verbose $(OBJS)
$(HEXBIN) -e BIN $(SRCS:.s=.ihx)
.s.rel:
$(AS) $(ASFLAGS) -o $@ $<
.S.rel:
$(AS) $(ASFLAGS) -o $@ $<
.c.rel:
$(CC) $(CFLAGS) $(INCDIR) -c $< -o $*.o
clean:
-rm -f *.rel
distclean: clean
-rm -f $(PROJ_NAME).BIN
# Create the container able to build the ROM
# The aim of the contianer is to not install dependencies on the computer
docker_build_container:
docker build -t m4 .
# Create the ROM inside the container
docker_build_rom: docker_build_container
make distclean
docker run --rm=true -v $$(pwd):/src/m4rom -t m4 make HEXBIN=hex2bin