forked from Megatokio/zasm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (73 loc) · 2.32 KB
/
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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#############################################################################
# Makefile for building zasm
#############################################################################
TARGET = zasm
CC = gcc
CXX = g++
LINK = g++
#CC = clang
#CXX = clang++
#LINK = clang++
STRIP = strip
DEFINES = -DNDEBUG -DRELEASE
CFLAGS = -pipe -Os -Wall -W -fPIE $(DEFINES)
CXXFLAGS = $(CFLAGS) -Wno-multichar -std=c++11
INCPATH = -I. -ISource -ILibraries
ifeq ($(OS),Windows_NT)
# static linking for Cygwin:
LFLAGS = -static
else
LFLAGS =
endif
LIBS = -lpthread -lz
SRCS := $(wildcard Source/*.cpp)
OBJS := $(SRCS:Source/%.cpp=tmp/%.o)
OBJECTS = \
tmp/cstrings.o \
tmp/exceptions.o \
tmp/FD.o \
tmp/tempmem.o \
tmp/files.o \
tmp/z80_clock_cycles.o \
tmp/z80_opcode_length.o \
tmp/z80_disass.o \
tmp/kio.o \
tmp/WavFile.o \
tmp/audio.o \
$(OBJS)
.PHONY: all clean test
all: $(TARGET)
clean:
rm tmp/*.o $(TARGET)
test: $(TARGET)
$(TARGET) -T
$(TARGET): tmp/ Makefile $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS)
$(STRIP) $(TARGET)
tmp/:
mkdir -p tmp
####### Compile
tmp/%.o : Source/%.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
tmp/cstrings.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/cstrings.o Libraries/cstrings/cstrings.cpp
tmp/exceptions.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/exceptions.o Libraries/kio/exceptions.cpp
tmp/FD.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/FD.o Libraries/unix/FD.cpp
tmp/tempmem.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/tempmem.o Libraries/cstrings/tempmem.cpp
tmp/files.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/files.o Libraries/unix/files.cpp
tmp/z80_clock_cycles.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/z80_clock_cycles.o Libraries/Z80/goodies/z80_clock_cycles.cpp
tmp/z80_opcode_length.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/z80_opcode_length.o Libraries/Z80/goodies/z80_opcode_length.cpp
tmp/z80_disass.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/z80_disass.o Libraries/Z80/goodies/z80_disass.cpp
tmp/kio.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/kio.o Libraries/kio/kio.cpp
tmp/WavFile.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/WavFile.o Libraries/audio/WavFile.cpp
tmp/audio.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/audio.o Libraries/audio/audio.cpp