-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (36 loc) · 991 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
44
45
46
47
48
DESTDIR = /usr/local
CXX = g++
CXXFLAGS = -g
CXXLIBS = -lX11 -lGL -lpthread -lpng -lstdc++fs -std=c++17
PWD = $(shell pwd)
INCLUDE = -I$(PWD)/common
PROJECT = JD1304
EXECUTABLE = $(PROJECT)
EXECUTABLE_ARGS = examples/prg.bin step
EXECUTABLE2_ARGS = examples/test.jds output.bin
MISC = RAM.bin \
*.dump
OBJECTS = emu/monitor.o \
emu/JD1304.o \
asm/jdasm.o \
main.o
run: $(EXECUTABLE)
./$(EXECUTABLE) $(EXECUTABLE_ARGS)
JDASM: $(EXECUTABLE)
cp $(EXECUTABLE) JDASM
run_JDASM: JDASM
./JDASM $(EXECUTABLE2_ARGS)
./JD1304 output.bin step
install:
install -d ${DESTDIR}/bin
install -d ${DESTDIR}/share/doc/$(EXECUTABLE)
install -m 755 $(EXECUTABLE) ${DESTDIR}/bin
install -m 755 JDASM ${DESTDIR}/bin
install -m 644 Readme.md ${DESTDIR}/share/doc/$(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $(OBJECTS) $(CXXLIBS)
%.o: %.cpp
@echo "Compiling $<"
$(CXX) $(CXXFLAGS) $(INCLUDE) -c $< -o $@
clean:
rm -f $(OBJECTS) $(EXECUTABLE) JDASM $(MISC)