-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
executable file
·126 lines (112 loc) · 3.36 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
WXCONFIG = wx-config
CPP = `$(WXCONFIG) --cxx`
CXXFLAGS= `$(WXCONFIG) --cxxflags` -O2
LDFLAGS = `$(WXCONFIG) --libs`
RC = `$(WXCONFIG) --rescomp`
#RC = x86_64-w64-mingw32-windres --define WX_CPU_AMD64
RCFLAGS = `$(WXCONFIG) --cxxflags`
MSGFMT = msgfmt
SOURCES= src/MeteoriteApp.cpp\
src/MeteoriteGUI.cpp\
src/MeteoriteMain.cpp\
src/meteorite.cpp
OBJECTS=$(SOURCES:.cpp=.o)
DEPENDS=$(OBJECTS:.o=.d)
RESOURCES= resources/resource.rc
RESOURCE_OBJ=$(RESOURCES:.rc=.o)
EXECUTABLE=meteorite
EXECUTABLE_WIN=Meteorite.exe
DESTDIR =
PREFIX = $(DESTDIR)/usr
BINDIR = $(PREFIX)/bin
DATADIR = $(PREFIX)/share
LOCALEDIR = $(DATADIR)/locale
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CPP) $(OBJECTS) $(LDFLAGS) -o $@
win: $(SOURCES) $(RESOURCES) $(EXECUTABLE_WIN)
$(EXECUTABLE_WIN): $(OBJECTS) $(RESOURCE_OBJ)
$(CPP) $(OBJECTS) $(RESOURCE_OBJ) $(LDFLAGS) -static-libstdc++ -static-libgcc -o $@
%.o : %.rc
$(RC) $(RCFLAGS) $< -o $@
.cpp.o:
$(CPP) $(CXXFLAGS) -c $< -o $@
install:
install -D -m 755 $(EXECUTABLE) $(BINDIR)/$(EXECUTABLE)
install -D -m 644 resources/$(EXECUTABLE).png $(DATADIR)/pixmaps/$(EXECUTABLE).png
install -D -m 644 resources/$(EXECUTABLE).desktop $(DATADIR)/applications/$(EXECUTABLE).desktop
uninstall:
rm $(BINDIR)/$(EXECUTABLE)
rm $(DATADIR)/pixmaps/$(EXECUTABLE).png
rm $(DATADIR)/applications/$(EXECUTABLE).desktop
rm $(LOCALEDIR)/*/LC_MESSAGES/$(EXECUTABLE).mo
test:
cat $(LANGUAGEDIRS)
clean:
rm -f src/*.o
rm -f resources/resource.o
rm -f locale/*/$(EXECUTABLE).mo
rm -f $(EXECUTABLE)
rm -f $(EXECUTABLE_WIN)
rm -rf $(EXECUTABLE).app
distclean: clean
mac: all
mkdir -p $(EXECUTABLE).app/Contents
mkdir -p $(EXECUTABLE).app/Contents/MacOS
mkdir -p $(EXECUTABLE).app/Contents/Resources
mv $(EXECUTABLE) $(EXECUTABLE).app/Contents/MacOS/
cp resources/$(EXECUTABLE).icns $(EXECUTABLE).app/Contents/Resources/
cp docs/* $(EXECUTABLE).app/Contents/Resources/
echo "APPLDivF" > $(EXECUTABLE).app/Contents/PkgInfo
echo "\
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n\
<plist version=\"1.0\">\n\
<dict>\n\
\t<key>CFBundleDevelopmentRegion</key>\n\
\t<string>English</string>\n\
\
\t<key>CFBundleExecutable</key>\n\
\t<string>$(EXECUTABLE)</string>\n\
\
\t<key>CFBundleGetInfoString</key>\n\
\t<string>$(EXECUTABLE) v0.11</string>\n\
\
\t<key>CFBundleIconFile</key>\n\
\t<string>$(EXECUTABLE).icns</string>\n\
\
\t<key>CFBundleIdentifier</key>\n\
\t<string>net.sourceforge.divfixpp</string>\n\
\
\t<key>CFBundleShortVersionString</key>\n\
\t<string>v0.11</string>\n\
\
\t<key>CFBundleInfoDictionaryVersion</key>\n\
\t<string>6.0</string>\n\
\
\t<key>CFBundleName</key>\n\
\t<string>$(EXECUTABLE)</string>\n\
\
\t<key>CFBundlePackageType</key>\n\
\t<string>APPL</string>\n\
\
\t<key>CFBundleSignature</key>\n\
\t<string>DivF</string>\n\
\
\t<key>CFBundleVersion</key>\n\
\t<string>1.0.0</string>\n\
\
\t<key>DRURLs</key>\n\
\t<string>http://divfixpp.sourceforge.net</string>\n\
\
\t<key>NSMainNibFile</key>\n\
\t<string>$(EXECUTABLE)</string>\n\
\
\t<key>NSPrincipalClass</key>\n\
\t<string>NSApplication</string>\n\
\
\t<key>NSHumanReadableCopyright</key>\n\
\t<string> (c) 2009-2011, Erdem U. Altinyurt</string>\n\
\
</dict>\n\
</plist>\n\n" > $(EXECUTABLE).app/Contents/Info.plist