-
Notifications
You must be signed in to change notification settings - Fork 15
/
makefile.mingw
76 lines (59 loc) · 2.78 KB
/
makefile.mingw
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
70
71
72
73
74
75
76
# Project: VM65
# Makefile created by Dev-C++ 5.11
# and modified for standalone MINGW compiler installation.
# NOTE:
# Set SDLDIR and MINGWDIR in your compilation environment,
# and then
# set PATH=%MINGWDIR%\mingw64\bin;%SDLDIR%\lib\x64;%PATH%
#SDLDIR = "D:\src\SDL"
#MINGWDIR = "C:\mingw-w64\x86_64-8.1.0"
SDLBASE = $(SDLDIR)
CPP = g++.exe -D__DEBUG__
CC = gcc.exe -D__DEBUG__
WINDRES = windres.exe
OBJ = main.o VMachine.o MKCpu.o Memory.o Display.o GraphDisp.o MemMapDev.o MKGenException.o ConsoleIO.o MassStorage.o
OBJ2 = bin2hex.o
LINKOBJ = main.o VMachine.o MKCpu.o Memory.o Display.o GraphDisp.o MemMapDev.o MKGenException.o ConsoleIO.o MassStorage.o
LINKOBJ2 = bin2hex.o
LIBS = -L"$(MINGWDIR)\mingw64\x86_64-w64-mingw32/lib" -L"$(MINGWDIR)\mingw64\x86_64-w64-mingw32/lib" -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic -lmingw32
SDLLIBS = -L"$(SDLBASE)\x86_64-w64-mingw32/lib" -lSDL2main -lSDL2
INCS = -I"$(MINGWDIR)\mingw64/include" -I"$(MINGWDIR)\mingw64\x86_64-w64-mingw32/include" -I"$(MINGWDIR)\mingw64\lib\gcc\x86_64-w64-mingw32\$(GCCVER)/include"
CXXINCS = -I"$(MINGWDIR)\mingw64/include" -I"$(MINGWDIR)\mingw64\x86_64-w64-mingw32/include" -I"$(MINGWDIR)\mingw64\lib\gcc\x86_64-w64-mingw32\$(GCCVER)/include"
BIN = vm65.exe
BIN2 = bin2hex.exe
CXXFLAGS = $(CXXINCS) -std=c++11 -Wall -Wextra -pedantic -g3
SDLINCS = -I"$(SDLBASE)/include"
CFLAGS = $(INCS) -std=c++11 -Wall -Wextra -pedantic -g3
CXXFLAGS2 = $(CXXINCS)
CFLAGS2 = $(INCS)
RM = del /f
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) $(BIN2) all-after
clean: clean-custom
${RM} $(OBJ) $(OBJ2) $(BIN) $(BIN2)
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o $(BIN) $(LIBS) $(SDLLIBS)
main.o: main.cpp
$(CPP) -c main.cpp -o main.o $(CXXFLAGS) $(SDLINCS)
VMachine.o: VMachine.cpp VMachine.h
$(CPP) -c VMachine.cpp -o VMachine.o $(CXXFLAGS) $(SDLINCS)
MKCpu.o: MKCpu.cpp MKCpu.h
$(CPP) -c MKCpu.cpp -o MKCpu.o $(CXXFLAGS) $(SDLINCS)
Memory.o: Memory.cpp Memory.h
$(CPP) -c Memory.cpp -o Memory.o $(CXXFLAGS) $(SDLINCS)
Display.o: Display.cpp Display.h
$(CPP) -c Display.cpp -o Display.o $(CXXFLAGS)
GraphDisp.o: GraphDisp.cpp GraphDisp.h
$(CPP) -c GraphDisp.cpp -o GraphDisp.o $(CXXFLAGS) $(SDLINCS)
MemMapDev.o: MemMapDev.cpp MemMapDev.h
$(CPP) -c MemMapDev.cpp -o MemMapDev.o $(CXXFLAGS) $(SDLINCS)
MKGenException.o: MKGenException.cpp MKGenException.h
$(CPP) -c MKGenException.cpp -o MKGenException.o $(CXXFLAGS)
ConsoleIO.o: ConsoleIO.cpp ConsoleIO.h
$(CPP) -c ConsoleIO.cpp -o ConsoleIO.o $(CXXFLAGS)
MassStorage.o: MassStorage.cpp MassStorage.h
$(CPP) -c MassStorage.cpp -o MassStorage.o $(CXXFLAGS)
$(BIN2): $(OBJ2)
$(CC) $(LINKOBJ2) -o $(BIN2) $(LIBS)
bin2hex.o: bin2hex.c
$(CC) -c bin2hex.c -o bin2hex.o $(CFLAGS2)