-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
36 lines (30 loc) · 1021 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
# Set the path of the current directory
currentDirectory = $(abspath .)
# Get all the *.asm files
asmFiles = $(wildcard $(currentDirectory)/src/**/*.asm)
# Set path of Turbo Macro Pro Cross Assembler (TMPx) and C64 emulator (x64sc)
# depending on the current OS
ifeq ($(OS),Windows_NT)
TMPX = $(currentDirectory)/vendors/tmpx/TMPx.exe
X64SC := C:\VICE\x64sc.exe
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
TMPX = $(currentDirectory)/vendors/tmpx/tmpx
X64SC := /Applications/VICE/x64sc.app/Contents/MacOS/x64sc
endif
ifeq ($(UNAME_S),Darwin)
TMPX = $(currentDirectory)/vendors/tmpx/tmpx
X64SC := /Applications/VICE/x64sc.app/Contents/MacOS/x64sc
endif
endif
# Convert all *.asm files to *.prg files
convert: $(asmFiles:.asm=.prg)
%.prg : %.asm
$(TMPX) -i $< -o $@
# Load specific program into C64 emulator (x64sc)
load:
$(X64SC) $(currentDirectory)/src/${name}
# Remove all *.prg files in the src directory
clean:
rm -f $(currentDirectory)/src/**/*.prg