Mercurial > mercurial > hgweb_kaigo.hg.cgi
comparison Porori/Makefile @ 0:aaaa401818a1 draft
first commit.
| author | pyon <pyon@macmini> |
|---|---|
| date | Mon, 24 May 2021 21:32:58 +0900 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:aaaa401818a1 |
|---|---|
| 1 # Makefile for wxWidgets Application | |
| 2 # Last Change: 2020-02-12 15:59:48. | |
| 3 # by Takayuki Mutoh | |
| 4 # | |
| 5 | |
| 6 PROGNAME = porori | |
| 7 | |
| 8 ### Variables ### | |
| 9 ARCH = 64 | |
| 10 #ARCH = 32 | |
| 11 LOCAL = C:/msys64/home/muto/local$(ARCH) | |
| 12 OBJDIR = ./obj$(ARCH) | |
| 13 CXX = g++ | |
| 14 vpath %.cpp ./src | |
| 15 vpath %.h ./include | |
| 16 vpath %.rc ./image | |
| 17 | |
| 18 # For Microsoft Windows | |
| 19 ifdef COMSPEC | |
| 20 WXCXXFLAGS = -I./image -I$(LOCAL)/lib/wx/include/msw-unicode-static-3.1 -I$(LOCAL)/include/wx-3.1 -D_LARGEFILE_SOURCE=unknown -D__WXMSW__ -mthreads | |
| 21 WXLIBS = -L$(LOCAL)/lib -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_qa-3.1 -lwx_baseu_net-3.1 -lwx_mswu_html-3.1 -lwx_mswu_adv-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu-3.1 -lwxtiff-3.1 -lwxjpeg-3.1 -lwxpng-3.1 -lwxregexu-3.1 -lwxscintilla-3.1 -lwxexpat-3.1 -lwxzlib-3.1 -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc | |
| 22 LIBS = $(WXLIBS) -static | |
| 23 | |
| 24 EXECUTABLE = $(PROGNAME).exe | |
| 25 | |
| 26 # For Apple OSX | |
| 27 else | |
| 28 WXCXXFLAGS = -I/opt/local/lib/wx/include/osx_cocoa-unicode-2.9 -I/opt/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ | |
| 29 WXLIBS = -L/opt/local/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime -lwx_osx_cocoau_richtext-2.9 -lwx_osx_cocoau_xrc-2.9 -lwx_osx_cocoau_webview-2.9 -lwx_osx_cocoau_html-2.9 -lwx_osx_cocoau_qa-2.9 -lwx_osx_cocoau_adv-2.9 -lwx_osx_cocoau_core-2.9 -lwx_baseu_xml-2.9 -lwx_baseu_net-2.9 -lwx_baseu-2.9 | |
| 30 | |
| 31 EXECUTABLE = $(PROGNAME).app/Contents/Pkginfo | |
| 32 | |
| 33 endif | |
| 34 | |
| 35 CXXFLAGS = $(WXCXXFLAGS) -I./include -I./image | |
| 36 #LIBS = $(WXLIBS) -static-libgcc -static-libstdc++ | |
| 37 | |
| 38 | |
| 39 OBJ = $(OBJDIR)/main.o \ | |
| 40 $(OBJDIR)/porori.o | |
| 41 | |
| 42 ifdef COMSPEC | |
| 43 OBJMSW = $(OBJ) $(OBJDIR)/sample_rc.o | |
| 44 endif | |
| 45 | |
| 46 | |
| 47 ### Targets ### | |
| 48 | |
| 49 all: $(EXECUTABLE) | |
| 50 | |
| 51 | |
| 52 $(PROGNAME): $(OBJMSW) | |
| 53 $(CXX) $^ -o $@ $(LIBS) | |
| 54 | |
| 55 | |
| 56 $(OBJDIR)/main.o: main.cpp main.h porori.h | |
| 57 -mkdir -p $(OBJDIR) | |
| 58 $(CXX) -c $< -o $@ $(CXXFLAGS) | |
| 59 | |
| 60 $(OBJDIR)/porori.o: porori.cpp porori.h | |
| 61 $(CXX) -c $< -o $@ $(CXXFLAGS) | |
| 62 | |
| 63 | |
| 64 # for icon | |
| 65 ifdef COMSPEC | |
| 66 $(OBJDIR)/sample_rc.o: sample.rc | |
| 67 #windres -i sample.rc -o $@ -I$(LOCAL)/include/wx-3.1 | |
| 68 windres -i $< -o $@ -I$(LOCAL)/include/wx-3.1 | |
| 69 endif | |
| 70 | |
| 71 $(EXECUTABLE): $(PROGNAME) | |
| 72 ifdef COMSPEC | |
| 73 strip --strip-all $(EXECUTABLE) | |
| 74 ./$(PROGNAME).exe | |
| 75 else | |
| 76 -mkdir -p $(PROGNAME).app/Contents | |
| 77 -mkdir -p $(PROGNAME).app/Contents/MacOS | |
| 78 -mkdir -p $(PROGNAME).app/Contents/Resources | |
| 79 | |
| 80 sed -e "s/IDENTIFIER/$(PROGNAME)/" \ | |
| 81 -e "s/EXECUTABLE/$(PROGNAME)/" \ | |
| 82 -e "s/VERSION/0.0/" \ | |
| 83 Info.plist.in > $(PROGNAME).app/Contents/Info.plist | |
| 84 | |
| 85 echo -n "APPL????" > $(EXECUTABLE) | |
| 86 | |
| 87 ln -f $(PROGNAME) $(PROGNAME).app/Contents/MacOS/$(PROGNAME) | |
| 88 cp -f wxmac.icns $(PROGNAME).app/Contents/Resources/wxmac.icns | |
| 89 | |
| 90 open $(PROGNAME).app | |
| 91 endif | |
| 92 | |
| 93 clean: | |
| 94 rm -f $(PROGNAME) $(PROGNAME).exe | |
| 95 rm -f $(OBJDIR)/*.o | |
| 96 rm -rf $(PROGNAME).app | |
| 97 | |
| 98 .PHONY: all clean | |
| 99 |
