1 ifeq ($(TARGET_PLATFORM),MAC)
2 WXCONFIG_PREFIX = $(HOME)/Development/wxMac/osx-build/
3 CPP_EXTRA_FLAGS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc -arch i386 -DUSE_RUBY=1 -g
4 LD_EXTRA_FLAGS = -framework Accelerate -framework GLUT
5 RUBY_DIR = $(HOME)/Development/ruby-1.8.7-static
6 RUBY_CFLAGS = -I$(RUBY_DIR)
7 RUBY_LDFLAGS = -L$(RUBY_DIR) -lruby-static
11 ifeq ($(TARGET_PLATFORM),MSW)
12 WXCONFIG_PREFIX = $(HOME)/wxMSW-2.8.9/msw-build/
13 CPP_EXTRA_FLAGS = -O2 -I/lib/clapack -g
14 LD_EXTRA_FLAGS = -L/lib/clapack -llapack -lblas -lf2c_nomain
15 RUBY_DIR = $(HOME)/ruby-1.8.7-static
16 RUBY_CFLAGS = -I$(RUBY_DIR)
17 # RUBY_LDFLAGS = -L$(RUBY_DIR) -lruby-static /c/Ruby/bin/msvcrt-ruby18.dll
18 RUBY_LDFLAGS = -L$(RUBY_DIR) -lmsvcrt-ruby18-static -lws2_32
19 EXECUTABLE = _Molby.exe_
20 FINAL_EXECUTABLE = Molby.exe
23 WXLIB_LIST = core,base,gl,adv
24 OBJECTS = ConsoleFrame.o GlobalParameterFrame.o GlobalParameterFilesFrame.o MoleculeView.o MyApp.o MyCommand.o MyDocument.o MyGLCanvas.o MySlider.o MyClipboardData.o ProgressFrame.o MyListCtrl.o MyDocManager.o RubyDialogFrame.o MyVersion.o MyThread.o MolLib.a Ruby_bind.a
25 RUBY_EXTLIB = scanf.rb
27 ifeq ($(TARGET_PLATFORM),MAC)
31 PRODUCT = $(PRODUCT_DIR)/$(EXECUTABLE)
35 CFLAGS = $(CPPFLAGS) $(CPP_EXTRA_FLAGS) $(RUBY_CFLAGS) $(shell $(WXCONFIG_PREFIX)wx-config --cppflags)
36 LDFLAGS = $(shell $(WXCONFIG_PREFIX)wx-config --libs $(WXLIB_LIST)) $(LD_EXTRA_FLAGS) $(RUBY_LDFLAGS)
38 DESTDIR = $(PWD)/$(DESTPREFIX)
43 all: $(DESTPREFIX) $(DESTPREFIX)/$(PRODUCT)
46 mkdir -p $(DESTPREFIX)
48 $(DESTPREFIX)/amber11 : ../amber11/src/antechamber/*.[ch] ../amber11/src/sqm/*.f ../amber11/src/config.h
49 make -f ../Makefile_amber11
51 ifeq ($(TARGET_PLATFORM),MSW)
52 EXTRA_OBJECTS = listctrl.o
54 # The following HOMETEMP kludges are to work around a bug where '#include "..."'
55 # does not work when the include path is on the C: drive whereas the source is
56 # on the Z: drive. 2009.7.24. Toshi Nagata
57 HOMETEMP = $(HOME)/__molby_temp_build__
58 $(DESTPREFIX)/$(RESOURCE) : molby.rc
59 mkdir -p $(HOMETEMP)/msw_build $(HOMETEMP)/bitmaps
60 cp molby.rc $(HOMETEMP)/msw_build
61 cp ../bitmaps/*.ico $(HOMETEMP)/bitmaps
62 (cd $(HOMETEMP)/msw_build; windres -i molby.rc -o molby_rc.o -I$(HOME)/wxMSW-2.8.9/include)
63 cp $(HOMETEMP)/msw_build/molby_rc.o $@
67 $(DESTPREFIX)/%.o : ../wxSources/%.cpp
68 $(CC) -c $< -o $@ $(CFLAGS)
70 $(DESTPREFIX)/%.o : ../wxSources/%.c
71 $(CC) -c $< -o $@ $(CFLAGS)
73 $(DESTPREFIX)/MolLib.a : ../MolLib/*.[ch] ../MolLib/MD/*.[ch]
74 mkdir -p $(DESTPREFIX)/MolLib/MD; cd ../MolLib; $(MAKE)
76 $(DESTPREFIX)/Ruby_bind.a : ../MolLib/Ruby_bind/*.[ch]
77 mkdir -p $(DESTPREFIX)/MolLib/Ruby_bind; cd ../MolLib/Ruby_bind; $(MAKE)
79 ALL_OBJECTS = $(OBJECTS) $(EXTRA_OBJECTS) $(RESOURCE)
80 DESTOBJECTS = $(addprefix $(DESTPREFIX)/,$(ALL_OBJECTS))
81 $(DESTPREFIX)/$(EXECUTABLE) : $(DESTOBJECTS)
82 $(CC) -o $@ $(DESTOBJECTS) $(CFLAGS) $(LDFLAGS)
84 $(DESTPREFIX)/$(PRODUCT) : $(DESTPREFIX)/$(EXECUTABLE) ../Scripts/*.rb $(DESTPREFIX)/amber11
85 ifeq ($(TARGET_PLATFORM),MAC)
86 rm -rf $(DESTPREFIX)/$(PRODUCT)
87 mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/MacOS
88 mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
89 cp -f Info.plist $(DESTPREFIX)/$(PRODUCT)/Contents
90 echo -n "APPL????" > $(DESTPREFIX)/$(PRODUCT)/Contents/PkgInfo
91 cp -r ../Scripts $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
92 cp -r $(DESTPREFIX)/amber11 $(DESTPREFIX)/$(PRODUCT)/Contents/Resources
93 mkdir -p $(DESTPREFIX)/$(PRODUCT)/Contents/Resources/Scripts/lib
94 for i in $(RUBY_EXTLIB); do cp $(RUBY_DIR)/lib/$$i $(DESTPREFIX)/$(PRODUCT)/Contents/Resources/Scripts/lib; done
95 cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT)/Contents/MacOS
97 ifeq ($(TARGET_PLATFORM),MSW)
98 rm -rf $(DESTPREFIX)/$(PRODUCT_DIR)
99 mkdir -p $(DESTPREFIX)/$(PRODUCT_DIR)
100 cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
101 cp `which mingwm10.dll` $(DESTPREFIX)/$(PRODUCT_DIR)
102 cp -r ../Scripts $(DESTPREFIX)/$(PRODUCT_DIR)
103 cp -r $(DESTPREFIX)/amber11 $(DESTPREFIX)/$(PRODUCT_DIR)
104 mkdir -p $(DESTPREFIX)/$(PRODUCT_DIR)/Scripts/lib
105 for i in $(RUBY_EXTLIB); do cp $(RUBY_DIR)/lib/$$i $(DESTPREFIX)/$(PRODUCT_DIR)/Scripts/lib; done
108 ifeq ($(TARGET_PLATFORM),MSW)
109 setup: $(DESTPREFIX)/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
110 /c/Program\ Files/Inno\ Setup\ 5/iscc molby.iss
114 rm -rf $(DESTPREFIX)/*
115 # rm -f $(EXECUTABLE) $(OBJECTS)
117 # cd ../MolLib; $(MAKE) clean
118 # cd ../MolLib/Ruby_bind; $(MAKE) clean