-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.mgw64
70 lines (49 loc) · 1.98 KB
/
Makefile.mgw64
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
PLUGDIR_XP12=openSAM-pkg/openSAM
PLUGDIR_XP11=openSAM-pkg_XP11/openSAM
OPENAL=../libOpenAL32
OBJDIR=./OBJ_win
include version.mak
include Makefile.common
TARGET_XP12=$(OBJDIR)/openSAM.xpl
TARGET_XP11=$(OBJDIR)/openSAM.xpl_xp11
HEADERS=$(wildcard *.h)
OBJECTS:=$(addprefix $(OBJDIR)/, $(SOURCES:.cpp=.o))
OBJECTS_XP12=$(OBJECTS) $(OBJDIR)/jwctrl_sound.o
OBJECTS_XP11=$(OBJECTS) $(OBJDIR)/jwctrl_sound_xp11.o
# all sources to the dep files
SOURCES_DEP=$(SOURCES) jwctrl_sound.cpp jwctrl_sound_xp11.cpp
DEPFILES=$(SOURCES_DEP:%.cpp=$(DEPDIR)/%.d)
DEPDIR := $(OBJDIR)/.deps
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
CXX=g++
LD=g++
CFLAGS+=$(CXXSTD) -DVERSION=\"$(VERSION)\" -g0 $(OPT) -Wextra -Wall \
-fdiagnostics-color -Wno-format-overflow -Wno-format-truncation \
-DWINDOWS -DWIN32 -DIBM=1 \
$(INCLUDES) $(DEBUG) -I$(OPENAL)
COMPILE.cpp = $(CXX) $(CFLAGS) $(DEPFLAGS) -c
LDFLAGS=-shared -static-libgcc -static -lpthread
LIBS=-L$(SDK)/Libraries/Win -lXPLM_64 -lXPWidgets_64 -l:libexpat.a
$(OBJDIR)/%.o: %.cpp $(DEPDIR)/%.d version.mak | $(DEPDIR)
$(COMPILE.cpp) -o $@ $<
install: install_xp12 install_xp11
all: install sam_xml_test.exe
$(DEPDIR): ; @mkdir -p $@
$(DEPFILES):
include $(wildcard $(DEPFILES))
$(TARGET_XP12): $(OBJECTS_XP12)
$(LD) -o $(TARGET_XP12) $(LDFLAGS) $(OBJECTS_XP12) $(LIBS)
install_xp12: $(TARGET_XP12)
mkdir -p "$(PLUGDIR_XP12)/win_x64"
cp -p $(TARGET_XP12) "$(PLUGDIR_XP12)/win_x64/."
$(TARGET_XP11): $(OBJECTS_XP11)
$(LD) -o $(TARGET_XP11) $(LDFLAGS) $(OBJECTS_XP11) $(LIBS) -L$(OPENAL) -lopenal32
install_xp11: $(TARGET_XP11)
mkdir -p "$(PLUGDIR_XP11)/win_x64"
cp -p $(TARGET_XP11) "$(PLUGDIR_XP11)/win_x64/openSAM.xpl"
clean:
rm -f ./$(OBJDIR)/* sam_xml_test.exe
sam_xml_test.exe: sam_xml_test.cpp sam_xml.cpp log_msg.cpp $(HEADERS)
$(CXX) $(CXXSTD) -Wall -fdiagnostics-color -Wno-format-overflow -I$(SDK)/CHeaders/XPLM -DIBM=1 \
-DWINDOWS -DWIN32 -DLOCAL_DEBUGSTRING -o sam_xml_test.exe \
sam_xml_test.cpp sam_xml.cpp log_msg.cpp -l:libexpat.a