-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (54 loc) · 1.61 KB
/
Makefile
File metadata and controls
69 lines (54 loc) · 1.61 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Path to RETRO68
RETRO68 := ../../../Retro68-build/toolchain
# Tools
PREFIX := $(RETRO68)/powerpc-apple-macos
CC := $(RETRO68)/bin/powerpc-apple-macos-gcc
CXX := $(RETRO68)/bin/powerpc-apple-macos-g++
REZ := $(RETRO68)/bin/Rez
# Libraries
LIBRARY_LFILES_PATH = ${PWD}/libs/LFiles/lib
INCLUDE_LFILES_PATH = ${PWD}/libs/LFiles/include
CFLAGS := -I$(INCLUDE_LFILES_PATH) -I${PWD}/src
CXXFLAGS := -I$(INCLUDE_LFILES_PATH) -I${PWD}/src
# Flags
# LDFLAGS := -L${PWD}/libs/LFiles/lib -lLFiles -lRetroConsole
LDFLAGS := -lRetroConsole -L$(LIBRARY_LFILES_PATH) -lLFiles
RINCLUDES := $(PREFIX)/RIncludes
REZFLAGS := -I$(RINCLUDES)
# Source files
SOURCES := main.cpp src/PIntro.cpp src/PMenu.cpp
OBJECTS := $(SOURCES:.cpp=.o)
# Targets
BINARIES := Pinax.bin Pinax.APPL Pinax.dsk
all: $(BINARIES)
# Build Pinax.bin
Pinax.bin: Pinax.flt
$(REZ) $(REZFLAGS) \
-DFLT_FILE_NAME=\"Pinax.flt\" "$(RINCLUDES)/Retro68APPL.r" \
-t APPL -c SWCH \
-o $@
# Build Pinax.APPL
Pinax.APPL: Pinax.flt
$(REZ) $(REZFLAGS) \
-DFLT_FILE_NAME=\"Pinax.flt\" "$(RINCLUDES)/Retro68APPL.r" \
--cc $@
# Build Pinax.dsk
Pinax.dsk: Pinax.flt
$(REZ) $(REZFLAGS) \
-DFLT_FILE_NAME=\"Pinax.flt\" "$(RINCLUDES)/Retro68APPL.r" \
--cc $@
# Link the object file into the flat binary
Pinax.flt: $(OBJECTS)
$(CXX) -v $< -o $@ $(LDFLAGS)
# C++ used for linking because RetroConsole needs it
# Implicit rule for object file
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean up generated files
.PHONY: clean
clean:
rm -f $(BINARIES) Pinax.flt Pinax.flt.gdb $(OBJECTS)