diff options
Diffstat (limited to 'portmidi/pm_mac/Makefile.osx')
| -rwxr-xr-x | portmidi/pm_mac/Makefile.osx | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/portmidi/pm_mac/Makefile.osx b/portmidi/pm_mac/Makefile.osx new file mode 100755 index 0000000..2044381 --- /dev/null +++ b/portmidi/pm_mac/Makefile.osx | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | # MAKEFILE FOR PORTMIDI | ||
| 2 | |||
| 3 | # Roger B. Dannenberg | ||
| 4 | # Sep 2009 | ||
| 5 | |||
| 6 | # NOTE: PortMidi is currently built and tested with CMake. | ||
| 7 | # This makefile is probably broken, but if you want to | ||
| 8 | # directly use make, start here, and please contribute any | ||
| 9 | # fixes. | ||
| 10 | |||
| 11 | # NOTE: you can use | ||
| 12 | # make -f pm_mac/Makefile.osx configuration=Release | ||
| 13 | # to override the default Debug configuration | ||
| 14 | configuration=Release | ||
| 15 | |||
| 16 | PF=/usr/local | ||
| 17 | |||
| 18 | # For debugging, define PM_CHECK_ERRORS | ||
| 19 | ifeq ($(configuration),Release) | ||
| 20 | CONFIG = Release | ||
| 21 | else | ||
| 22 | CONFIG = Debug | ||
| 23 | endif | ||
| 24 | |||
| 25 | current: all | ||
| 26 | |||
| 27 | all: $(CONFIG)/CMakeCache.txt | ||
| 28 | cd $(CONFIG); make | ||
| 29 | |||
| 30 | $(CONFIG)/CMakeCache.txt: | ||
| 31 | rm -f $(CONFIG)/CMakeCache.txt | ||
| 32 | mkdir -p $(CONFIG) | ||
| 33 | cd $(CONFIG); cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$(CONFIG) | ||
| 34 | |||
| 35 | |||
| 36 | **** For instructions: make -f pm_mac/Makefile.osx help ****\n' | ||
| 37 | |||
| 38 | help: | ||
| 39 | echo $$'\n\n\ | ||
| 40 | This is help for portmidi/pm_mac/Makefile.osx\n\n\ | ||
| 41 | Installation path for dylib is $(PF)\n\ | ||
| 42 | To build Release version libraries and test applications,\n \ | ||
| 43 | make -f pm_mac/Makefile.osx\n\ | ||
| 44 | To build Debug version libraries and test applications,\n \ | ||
| 45 | make -f pm_mac/Makefile.osx configuration=Debug\n\ | ||
| 46 | To install universal dynamic library,\n \ | ||
| 47 | sudo make -f pm_mac/Makefile.osx install\n\ | ||
| 48 | To install universal dynamic library with xcode,\n \ | ||
| 49 | make -f pm_mac/Makefile.osx install-with-xcode\n\ | ||
| 50 | To make PmDefaults Java application,\n \ | ||
| 51 | make -f pm_mac/Makefile.osx pmdefaults\n\n \ | ||
| 52 | configuration = $(configuration)\n' | ||
| 53 | |||
| 54 | |||
| 55 | clean: | ||
| 56 | rm -f *.o *~ core* */*.o */*/*.o */*~ */core* pm_test/*/pm_dll.dll | ||
| 57 | rm -f *.opt *.ncb *.plg pm_win/Debug/pm_dll.lib pm_win/Release/pm_dll.lib | ||
| 58 | rm -f pm_test/*.opt pm_test/*.ncb | ||
| 59 | rm -f pm_java/pmjni/*.o pm_java/pmjni/*~ pm_java/*.h | ||
| 60 | rm -rf Release/CMakeFiles Debug/CMakeFiles | ||
| 61 | rm -rf pm_mac/pmdefaults/lib pm_mac/pmdefaults/src | ||
| 62 | |||
| 63 | cleaner: clean | ||
| 64 | rm -rf pm_mac/build | ||
| 65 | rm -rf pm_mac/Debug pm_mac/Release pm_test/Debug pm_test/Release | ||
| 66 | rm -f Debug/*.dylib Release/*.dylib | ||
| 67 | rm -f pm_java/pmjni/Debug/*.jnilib | ||
| 68 | rm -f pm_java/pmjni/Release/*.jnilib | ||
| 69 | |||
| 70 | cleanest: cleaner | ||
| 71 | rm -f Debug/CMakeCache.txt Release/CMakeCache.txt | ||
| 72 | rm -f CMakeCache.txt | ||
| 73 | rm -f Debug/libportmidi_s.a Release/libportmidi_s.a | ||
| 74 | rm -f pm_test/Debug/test pm_test/Debug/sysex pm_test/Debug/midithread | ||
| 75 | rm -f pm_test/Debug/latency pm_test/Debug/midithru | ||
| 76 | rm -f pm_test/Debug/qtest pm_test/Debug/mm | ||
| 77 | rm -f pm_test/Release/test pm_test/Release/sysex pm_test/Release/midithread | ||
| 78 | rm -f pm_test/Release/latency pm_test/Release/midithru | ||
| 79 | rm -f pm_test/Release/qtest pm_test/Release/mm | ||
| 80 | rm -f pm_java/*/*.class | ||
| 81 | rm -f pm_java/pmjni/jportmidi_JPortMidiApi_PortMidiStream.h | ||
| 82 | |||
| 83 | backup: cleanest | ||
| 84 | cd ..; zip -r portmidi.zip portmidi | ||
| 85 | |||
| 86 | install: porttime/porttime.h pm_common/portmidi.h \ | ||
| 87 | $(CONFIG)/libportmidi.dylib | ||
| 88 | install porttime/porttime.h $(PF)/include/ | ||
| 89 | install pm_common/portmidi.h $(PF)/include | ||
| 90 | install $(CONFIG)/libportmidi.dylib $(PF)/lib/ | ||
| 91 | |||
| 92 | # note - this uses xcode to build and install portmidi universal binaries | ||
| 93 | install-with-xcode: | ||
| 94 | sudo xcodebuild -project pm_mac/pm_mac.xcodeproj \ | ||
| 95 | -configuration Release install DSTROOT=/ | ||
| 96 | |||
| 97 | ##### build pmdefault ###### | ||
| 98 | |||
| 99 | pm_java/pmjni/jportmidi_JPortMidiApi.h: pm_java/jportmidi/JPortMidiApi.class | ||
| 100 | cd pm_java; javah jportmidi.JPortMidiApi | ||
| 101 | mv pm_java/jportmidi_JportMidiApi.h pm_java/pmjni | ||
| 102 | |||
| 103 | JAVASRC = pmdefaults/PmDefaultsFrame.java \ | ||
| 104 | pmdefaults/PmDefaults.java \ | ||
| 105 | jportmidi/JPortMidiApi.java jportmidi/JPortMidi.java \ | ||
| 106 | jportmidi/JPortMidiException.java | ||
| 107 | |||
| 108 | # this compiles ALL of the java code | ||
| 109 | pm_java/jportmidi/JPortMidiApi.class: $(JAVASRC:%=pm_java/%) | ||
| 110 | cd pm_java; javac $(JAVASRC) | ||
| 111 | |||
| 112 | $(CONFIG)/libpmjni.dylib: | ||
| 113 | mkdir -p $(CONFIG) | ||
| 114 | cd $(CONFIG); make -f ../pm_mac/$(MAKEFILE) | ||
| 115 | |||
| 116 | pmdefaults: $(CONFIG)/libpmjni.dylib pm_java/jportmidi/JPortMidiApi.class | ||
| 117 | ifeq ($(CONFIG),Debug) | ||
| 118 | echo "Error: you cannot build pmdefaults in a Debug configuration \n\ | ||
| 119 | You should use configuration=Release in the Makefile command line. " | ||
| 120 | @exit 2 | ||
| 121 | endif | ||
| 122 | xcodebuild -project pm_mac/pm_mac.xcodeproj \ | ||
| 123 | -configuration Release -target PmDefaults | ||
| 124 | echo "pmdefaults java application is made" | ||
| 125 | |||
