├── .gitignore ├── LICENSE ├── README.md ├── build.zig ├── nativefiledialog ├── .github │ └── ISSUE_TEMPLATE │ │ └── bug_report.md ├── .gitignore ├── LICENSE ├── README.md ├── build │ ├── dont_run_premake.txt │ ├── gmake_linux │ │ ├── Makefile │ │ ├── nfd.make │ │ ├── test_opendialog.make │ │ ├── test_opendialogmultiple.make │ │ ├── test_pickfolder.make │ │ └── test_savedialog.make │ ├── gmake_linux_zenity │ │ ├── Makefile │ │ ├── nfd.make │ │ ├── test_opendialog.make │ │ ├── test_opendialogmultiple.make │ │ ├── test_pickfolder.make │ │ └── test_savedialog.make │ ├── gmake_macosx │ │ ├── Makefile │ │ ├── nfd.make │ │ ├── test_opendialog.make │ │ ├── test_opendialogmultiple.make │ │ ├── test_pickfolder.make │ │ └── test_savedialog.make │ ├── gmake_windows │ │ ├── Makefile │ │ ├── nfd.make │ │ ├── test_opendialog.make │ │ ├── test_opendialogmultiple.make │ │ ├── test_pickfolder.make │ │ └── test_savedialog.make │ ├── premake5.lua │ ├── vs2010 │ │ ├── NativeFileDialog.sln │ │ ├── nfd.vcxproj │ │ ├── nfd.vcxproj.filters │ │ ├── test_opendialog.vcxproj │ │ ├── test_opendialogmultiple.vcxproj │ │ ├── test_pickfolder.vcxproj │ │ └── test_savedialog.vcxproj │ └── xcode4 │ │ ├── NativeFileDialog.xcworkspace │ │ └── contents.xcworkspacedata │ │ ├── nfd.xcodeproj │ │ └── project.pbxproj │ │ ├── test_opendialog.xcodeproj │ │ └── project.pbxproj │ │ ├── test_opendialogmultiple.xcodeproj │ │ └── project.pbxproj │ │ ├── test_pickfolder.xcodeproj │ │ └── project.pbxproj │ │ └── test_savedialog.xcodeproj │ │ └── project.pbxproj ├── docs │ ├── build.md │ └── contributing.md ├── screens │ ├── open_cocoa.png │ ├── open_gtk3.png │ └── open_win.png ├── src │ ├── common.h │ ├── include │ │ └── nfd.h │ ├── nfd_cocoa.m │ ├── nfd_common.c │ ├── nfd_common.h │ ├── nfd_gtk.c │ ├── nfd_win.cpp │ ├── nfd_zenity.c │ └── simple_exec.h └── test │ ├── test_opendialog.c │ ├── test_opendialogmultiple.c │ ├── test_pickfolder.c │ └── test_savedialog.c └── src ├── c.zig ├── demo.zig └── lib.zig /.gitignore: -------------------------------------------------------------------------------- 1 | .zig-cache 2 | zig-cache 3 | zig-out -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Fabio Arnold 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nfd-zig 2 | 3 | `nfd-zig` is a Zig binding to the library [nativefiledialog](https://github.com/mlabbe/nativefiledialog) which provides a convenient cross-platform interface to opening file dialogs on Linux, macOS and Windows. 4 | 5 | This library has been tested on Windows 10, macOS 11.1 and Linux. 6 | 7 | ## Usage 8 | 9 | You can run a demo with `zig build run`. The demo's source is in `src/demo.zig`. 10 | 11 | If you want to add the library to your own project... 12 | 13 | - Add the `nfd` dependency to your `build.zig.zon` 14 | ```zig 15 | .{ 16 | .dependencies = .{ 17 | .nfd = .{ .path = "libs/nfd-zig" }, // Assuming nfd-zig is available in the local directory. Use .url otherwise. 18 | } 19 | } 20 | ``` 21 | - Add the import in your `build.zig`: 22 | ```zig 23 | const nfd = b.dependency("nfd", .{}); 24 | const nfd_mod = nfd.module("nfd"); 25 | exe.root_module.addImport("nfd", nfd_mod); 26 | ``` 27 | 28 | ## Screenshot 29 | 30 | ![Open dialog on Windows 10](https://raw.githubusercontent.com/mlabbe/nativefiledialog/67345b80ebb429ecc2aeda94c478b3bcc5f7888e/screens/open_win.png) 31 | -------------------------------------------------------------------------------- /build.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | 3 | pub fn build(b: *std.Build) !void { 4 | const target = b.standardTargetOptions(.{}); 5 | const optimize = b.standardOptimizeOption(.{}); 6 | 7 | const nfd_mod = b.addModule("nfd", .{ 8 | .root_source_file = b.path("src/lib.zig"), 9 | .target = target, 10 | .optimize = optimize, 11 | .link_libc = true, 12 | }); 13 | 14 | const cflags = [_][]const u8{"-Wall"}; 15 | nfd_mod.addIncludePath(b.path("nativefiledialog/src/include")); 16 | nfd_mod.addCSourceFile(.{ .file = b.path("nativefiledialog/src/nfd_common.c"), .flags = &cflags }); 17 | switch (target.result.os.tag) { 18 | .macos => nfd_mod.addCSourceFile(.{ .file = b.path("nativefiledialog/src/nfd_cocoa.m"), .flags = &cflags }), 19 | .windows => nfd_mod.addCSourceFile(.{ .file = b.path("nativefiledialog/src/nfd_win.cpp"), .flags = &cflags }), 20 | .linux => nfd_mod.addCSourceFile(.{ .file = b.path("nativefiledialog/src/nfd_gtk.c"), .flags = &cflags }), 21 | else => @panic("unsupported OS"), 22 | } 23 | 24 | switch (target.result.os.tag) { 25 | .macos => nfd_mod.linkFramework("AppKit", .{}), 26 | .windows => { 27 | nfd_mod.linkSystemLibrary("shell32", .{}); 28 | nfd_mod.linkSystemLibrary("ole32", .{}); 29 | nfd_mod.linkSystemLibrary("uuid", .{}); // needed by MinGW 30 | }, 31 | .linux => { 32 | nfd_mod.linkSystemLibrary("atk-1.0", .{}); 33 | nfd_mod.linkSystemLibrary("gdk-3", .{}); 34 | nfd_mod.linkSystemLibrary("gtk-3", .{}); 35 | nfd_mod.linkSystemLibrary("glib-2.0", .{}); 36 | nfd_mod.linkSystemLibrary("gobject-2.0", .{}); 37 | }, 38 | else => @panic("unsupported OS"), 39 | } 40 | 41 | var demo = b.addExecutable(.{ 42 | .name = "nfd-demo", 43 | .root_source_file = b.path("src/demo.zig"), 44 | .target = target, 45 | .optimize = optimize, 46 | }); 47 | demo.addIncludePath(b.path("nativefiledialog/src/include")); 48 | demo.root_module.addImport("nfd", nfd_mod); 49 | b.installArtifact(demo); 50 | 51 | const run_demo_cmd = b.addRunArtifact(demo); 52 | run_demo_cmd.step.dependOn(b.getInstallStep()); 53 | 54 | const run_demo_step = b.step("run", "Run the demo"); 55 | run_demo_step.dependOn(&run_demo_cmd.step); 56 | } 57 | -------------------------------------------------------------------------------- /nativefiledialog/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Compilation Environment** 11 | 12 | - OS (eg: OSX 10.14, Ubuntu 18.04): 13 | - Compiler (eg: GCC, Clang): 14 | - Compiler Version (eg: MSVC 2017): 15 | - Build directory used (eg: `build/gmake_linux`: 16 | - Have I attempted to reproduce the problem on the `devel` branch? 17 | 18 | **Describe the bug** 19 | 20 | _A clear and concise description of what the bug is._ 21 | 22 | **Compilation output** 23 | 24 | _If compiling with a makefile, paste the output of `make verbose=1` which includes Makefile steps._ 25 | 26 | **Additional context** 27 | 28 | _Add any other context about the problem here._ 29 | 30 | **User Description** 31 | 32 | _Are you using NFD as an individual, a small company (less than ten employees) or a larger organization? 33 | -------------------------------------------------------------------------------- /nativefiledialog/.gitignore: -------------------------------------------------------------------------------- 1 | .sconsign.dblite 2 | # Object files 3 | *.o 4 | *.ko 5 | *.obj 6 | *.elf 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | # Libraries 11 | *.lib 12 | *.a 13 | *.la 14 | *.lo 15 | # Shared objects (inc. Windows DLLs) 16 | *.dll 17 | *.so 18 | *.so.* 19 | *.dylib 20 | # Executables 21 | *.exe 22 | *.out 23 | *.app 24 | *.i*86 25 | *.x86_64 26 | *.hex 27 | 28 | ## Ignore Visual Studio temporary files, build results, and 29 | ## files generated by popular Visual Studio add-ons. 30 | # User-specific files 31 | *.suo 32 | *.user 33 | *.userosscache 34 | *.sln.docstates 35 | # User-specific folders 36 | *.sln.ide/ 37 | # Build results 38 | [Dd]ebug/ 39 | [Dd]ebugPublic/ 40 | [Rr]elease/ 41 | [Rr]eleases/ 42 | x64/ 43 | x86/ 44 | bld/ 45 | [Bb]in/ 46 | [Oo]bj/ 47 | # Roslyn cache directories 48 | *.ide/ 49 | # MSTest test Results 50 | [Tt]est[Rr]esult*/ 51 | [Bb]uild[Ll]og.* 52 | #NUNIT 53 | *.VisualState.xml 54 | TestResult.xml 55 | # Build Results of an ATL Project 56 | [Dd]ebugPS/ 57 | [Rr]eleasePS/ 58 | dlldata.c 59 | *_i.c 60 | *_p.c 61 | *_i.h 62 | *.ilk 63 | *.meta 64 | *.obj 65 | *.pch 66 | *.pdb 67 | *.pgc 68 | *.pgd 69 | *.rsp 70 | *.sbr 71 | *.tlb 72 | *.tli 73 | *.tlh 74 | *.tmp 75 | *.tmp_proj 76 | *.log 77 | *.vspscc 78 | *.vssscc 79 | .builds 80 | *.pidb 81 | *.svclog 82 | *.scc 83 | # Chutzpah Test files 84 | _Chutzpah* 85 | # Visual C++ cache files 86 | ipch/ 87 | *.aps 88 | *.ncb 89 | *.opensdf 90 | *.sdf 91 | *.cachefile 92 | # Visual Studio profiler 93 | *.psess 94 | *.vsp 95 | *.vspx 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | # ReSharper is a .NET coding add-in 101 | _ReSharper*/ 102 | *.[Rr]e[Ss]harper 103 | *.DotSettings.user 104 | # JustCode is a .NET coding addin-in 105 | .JustCode 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | # NCrunch 111 | _NCrunch_* 112 | .*crunch*.local.xml 113 | # MightyMoose 114 | *.mm.* 115 | AutoTest.Net/ 116 | # Web workbench (sass) 117 | .sass-cache/ 118 | # Installshield output folder 119 | [Ee]xpress/ 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | # Click-Once directory 130 | publish/ 131 | # Publish Web Output 132 | *.[Pp]ublish.xml 133 | *.azurePubxml 134 | # TODO: Comment the next line if you want to checkin your web deploy settings 135 | # but database connection strings (with potential passwords) will be unencrypted 136 | *.pubxml 137 | *.publishproj 138 | # NuGet Packages 139 | *.nupkg 140 | # The packages folder can be ignored because of Package Restore 141 | **/packages/* 142 | # except build/, which is used as an MSBuild target. 143 | !**/packages/build/ 144 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 145 | #!**/packages/repositories.config 146 | # Windows Azure Build Output 147 | csx/ 148 | *.build.csdef 149 | # Windows Store app package directory 150 | AppPackages/ 151 | # Others 152 | sql/ 153 | *.Cache 154 | ClientBin/ 155 | [Ss]tyle[Cc]op.* 156 | ~$* 157 | *~ 158 | *.dbmdl 159 | *.dbproj.schemaview 160 | *.pfx 161 | *.publishsettings 162 | node_modules/ 163 | bower_components/ 164 | # RIA/Silverlight projects 165 | Generated_Code/ 166 | # Backup & report files from converting an old project file 167 | # to a newer Visual Studio version. Backup files are not needed, 168 | # because we have git ;-) 169 | _UpgradeReport_Files/ 170 | Backup*/ 171 | UpgradeLog*.XML 172 | UpgradeLog*.htm 173 | # SQL Server files 174 | *.mdf 175 | *.ldf 176 | # Business Intelligence projects 177 | *.rdl.data 178 | *.bim.layout 179 | *.bim_*.settings 180 | # Microsoft Fakes 181 | FakesAssemblies/ 182 | -------------------------------------------------------------------------------- /nativefiledialog/LICENSE: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any damages 3 | arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, 6 | including commercial applications, and to alter it and redistribute it 7 | freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not 10 | claim that you wrote the original software. If you use this software 11 | in a product, an acknowledgment in the product documentation would be 12 | appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be 14 | misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | 17 | -------------------------------------------------------------------------------- /nativefiledialog/README.md: -------------------------------------------------------------------------------- 1 | # Native File Dialog # 2 | 3 | A tiny, neat C library that portably invokes native file open, folder select and save dialogs. Write dialog code once and have it pop up native dialogs on all supported platforms. Avoid linking large dependencies like wxWidgets and qt. 4 | 5 | Features: 6 | 7 | - Lean C API, static library -- no ObjC, no C++, no STL. 8 | - Zlib licensed. 9 | - Consistent UTF-8 support on all platforms. 10 | - Simple universal file filter syntax. 11 | - Paid support available. 12 | - Multiple file selection support. 13 | - 64-bit and 32-bit friendly. 14 | - GCC, Clang, Xcode, Mingw and Visual Studio supported. 15 | - No third party dependencies for building or linking. 16 | - Support for Vista's modern `IFileDialog` on Windows. 17 | - Support for non-deprecated Cocoa APIs on OS X. 18 | - GTK3 dialog on Linux. 19 | - Optional Zenity support on Linux to avoid linking GTK. 20 | - Tested, works alongside [http://www.libsdl.org](SDL2) on all platforms, for the game developers out there. 21 | 22 | # Example Usage # 23 | 24 | ```C 25 | #include 26 | #include 27 | #include 28 | 29 | int main( void ) 30 | { 31 | nfdchar_t *outPath = NULL; 32 | nfdresult_t result = NFD_OpenDialog( NULL, NULL, &outPath ); 33 | 34 | if ( result == NFD_OKAY ) { 35 | puts("Success!"); 36 | puts(outPath); 37 | free(outPath); 38 | } 39 | else if ( result == NFD_CANCEL ) { 40 | puts("User pressed cancel."); 41 | } 42 | else { 43 | printf("Error: %s\n", NFD_GetError() ); 44 | } 45 | 46 | return 0; 47 | } 48 | ``` 49 | 50 | See self-documenting API [NFD.h](src/include/nfd.h) for more options. 51 | 52 | # Screenshots # 53 | 54 | ![Windows rendering a dialog](screens/open_win.png?raw=true) 55 | ![GTK3 on Linux rendering a dialog](screens/open_gtk3.png?raw=true) 56 | ![Cocoa on MacOS rendering a dialog](screens/open_cocoa.png?raw=true) 57 | 58 | ## Changelog ## 59 | 60 | - **Major** version increments denote API or ABI departure. 61 | - **Minor** version increments denote build or trivial departures. 62 | - **Micro** version increments just recompile and drop-in. 63 | 64 | release | what's new | date 65 | --------|-----------------------------|--------- 66 | 1.0.0 | initial | oct 2014 67 | 1.1.0 | premake5; scons deprecated | aug 2016 68 | 1.1.1 | mingw support, build fixes | aug 2016 69 | 1.1.2 | test_pickfolder() added | aug 2016 70 | 1.1.3 | zenity linux backend added | nov 2017 71 | | fix char type in decls | nov 2017 72 | 1.1.4 | fix win32 memleaks | dec 2018 73 | | improve win32 errorhandling | dec 2018 74 | | macos fix focus bug | dec 2018 75 | 1.1.5 | win32 fix com reinitialize | aug 2019 76 | 1.1.6 | fix osx filter bug | aug 2019 77 | | remove deprecated scons | aug 2019 78 | | fix mingw compilation | aug 2019 79 | | -Wextra warning cleanup | aug 2019 80 | 81 | ## Building ## 82 | 83 | NFD uses [Premake5](https://premake.github.io/download.html) generated Makefiles and IDE project files. The generated project files are checked in under `build/` so you don't have to download and use Premake in most cases. 84 | 85 | If you need to run Premake5 directly, further [build documentation](docs/build.md) is available. 86 | 87 | Previously, NFD used SCons to build. As of 1.1.6, SCons support has been removed entirely. 88 | 89 | `nfd.a` will be built for release builds, and `nfd_d.a` will be built for debug builds. 90 | 91 | ### Makefiles ### 92 | 93 | The makefile offers up to four options, with `release_x64` as the default. 94 | 95 | make config=release_x86 96 | make config=release_x64 97 | make config=debug_x86 98 | make config=debug_x64 99 | 100 | ### Compiling Your Programs ### 101 | 102 | 1. Add `src/include` to your include search path. 103 | 2. Add `nfd.lib` or `nfd_d.lib` to the list of list of static libraries to link against (for release or debug, respectively). 104 | 3. Add `build//` to the library search path. 105 | 106 | #### Linux GTK #### 107 | 108 | `apt-get libgtk-3-dev` installs the gtk dependency for library compilation. 109 | 110 | On Linux, you have the option of compiling and linking against GTK. If you use it, the recommended way to compile is to include the arguments of `pkg-config --cflags --libs gtk+-3.0`. 111 | 112 | #### Linux Zenity #### 113 | 114 | Alternatively, you can use the Zenity backend by running the Makefile in `build/gmake_linux_zenity`. Zenity runs the dialog in its own address space, but requires the user to have Zenity correctly installed and configured on their system. 115 | 116 | #### MacOS #### 117 | 118 | On Mac OS, add `AppKit` to the list of frameworks. 119 | 120 | #### Windows #### 121 | 122 | On Windows, ensure you are linking against `comctl32.lib`. 123 | 124 | ## Usage ## 125 | 126 | See `NFD.h` for API calls. See `tests/*.c` for example code. 127 | 128 | After compiling, `build/bin` contains compiled test programs. The appropriate subdirectory under `build/lib` contains the built library. 129 | 130 | ## File Filter Syntax ## 131 | 132 | There is a form of file filtering in every file dialog API, but no consistent means of supporting it. NFD provides support for filtering files by groups of extensions, providing its own descriptions (where applicable) for the extensions. 133 | 134 | A wildcard filter is always added to every dialog. 135 | 136 | ### Separators ### 137 | 138 | - `;` Begin a new filter. 139 | - `,` Add a separate type to the filter. 140 | 141 | #### Examples #### 142 | 143 | `txt` The default filter is for text files. There is a wildcard option in a dropdown. 144 | 145 | `png,jpg;psd` The default filter is for png and jpg files. A second filter is available for psd files. There is a wildcard option in a dropdown. 146 | 147 | `NULL` Wildcard only. 148 | 149 | ## Iterating Over PathSets ## 150 | 151 | See [test_opendialogmultiple.c](test/test_opendialogmultiple.c). 152 | 153 | # Known Limitations # 154 | 155 | I accept quality code patches, or will resolve these and other matters through support. See [contributing](docs/contributing.md) for details. 156 | 157 | - No support for Windows XP's legacy dialogs such as `GetOpenFileName`. 158 | - No support for file filter names -- ex: "Image Files" (*.png, *.jpg). Nameless filters are supported, however. 159 | - GTK Zenity implementation's process exec error handling does not gracefully handle numerous error cases, choosing to abort rather than cleanup and return. 160 | - GTK 3 spams one warning per dialog created. 161 | 162 | # Copyright and Credit # 163 | 164 | Copyright © 2014-2019 [Frogtoss Games](http://www.frogtoss.com), Inc. 165 | File [LICENSE](LICENSE) covers all files in this repo. 166 | 167 | Native File Dialog by Michael Labbe 168 | 169 | 170 | Tomasz Konojacki for [microutf8](http://puszcza.gnu.org.ua/software/microutf8/) 171 | 172 | [Denis Kolodin](https://github.com/DenisKolodin) for mingw support. 173 | 174 | [Tom Mason](https://github.com/wheybags) for Zenity support. 175 | 176 | ## Support ## 177 | 178 | Directed support for this work is available from the original author under a paid agreement. 179 | 180 | [Contact Frogtoss Games](http://www.frogtoss.com/pages/contact.html). 181 | -------------------------------------------------------------------------------- /nativefiledialog/build/dont_run_premake.txt: -------------------------------------------------------------------------------- 1 | Premake-generated build systems are already checked in, in build subdirectories. Use one of them before attempting to run premake. See docs/build.md for more. 2 | -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/Makefile: -------------------------------------------------------------------------------- 1 | # GNU Make workspace makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | ifeq ($(config),release_x64) 12 | nfd_config = release_x64 13 | test_pickfolder_config = release_x64 14 | test_opendialog_config = release_x64 15 | test_opendialogmultiple_config = release_x64 16 | test_savedialog_config = release_x64 17 | endif 18 | ifeq ($(config),release_x86) 19 | nfd_config = release_x86 20 | test_pickfolder_config = release_x86 21 | test_opendialog_config = release_x86 22 | test_opendialogmultiple_config = release_x86 23 | test_savedialog_config = release_x86 24 | endif 25 | ifeq ($(config),debug_x64) 26 | nfd_config = debug_x64 27 | test_pickfolder_config = debug_x64 28 | test_opendialog_config = debug_x64 29 | test_opendialogmultiple_config = debug_x64 30 | test_savedialog_config = debug_x64 31 | endif 32 | ifeq ($(config),debug_x86) 33 | nfd_config = debug_x86 34 | test_pickfolder_config = debug_x86 35 | test_opendialog_config = debug_x86 36 | test_opendialogmultiple_config = debug_x86 37 | test_savedialog_config = debug_x86 38 | endif 39 | 40 | PROJECTS := nfd test_pickfolder test_opendialog test_opendialogmultiple test_savedialog 41 | 42 | .PHONY: all clean help $(PROJECTS) 43 | 44 | all: $(PROJECTS) 45 | 46 | nfd: 47 | ifneq (,$(nfd_config)) 48 | @echo "==== Building nfd ($(nfd_config)) ====" 49 | @${MAKE} --no-print-directory -C . -f nfd.make config=$(nfd_config) 50 | endif 51 | 52 | test_pickfolder: nfd 53 | ifneq (,$(test_pickfolder_config)) 54 | @echo "==== Building test_pickfolder ($(test_pickfolder_config)) ====" 55 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make config=$(test_pickfolder_config) 56 | endif 57 | 58 | test_opendialog: nfd 59 | ifneq (,$(test_opendialog_config)) 60 | @echo "==== Building test_opendialog ($(test_opendialog_config)) ====" 61 | @${MAKE} --no-print-directory -C . -f test_opendialog.make config=$(test_opendialog_config) 62 | endif 63 | 64 | test_opendialogmultiple: nfd 65 | ifneq (,$(test_opendialogmultiple_config)) 66 | @echo "==== Building test_opendialogmultiple ($(test_opendialogmultiple_config)) ====" 67 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make config=$(test_opendialogmultiple_config) 68 | endif 69 | 70 | test_savedialog: nfd 71 | ifneq (,$(test_savedialog_config)) 72 | @echo "==== Building test_savedialog ($(test_savedialog_config)) ====" 73 | @${MAKE} --no-print-directory -C . -f test_savedialog.make config=$(test_savedialog_config) 74 | endif 75 | 76 | clean: 77 | @${MAKE} --no-print-directory -C . -f nfd.make clean 78 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make clean 79 | @${MAKE} --no-print-directory -C . -f test_opendialog.make clean 80 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make clean 81 | @${MAKE} --no-print-directory -C . -f test_savedialog.make clean 82 | 83 | help: 84 | @echo "Usage: make [config=name] [target]" 85 | @echo "" 86 | @echo "CONFIGURATIONS:" 87 | @echo " release_x64" 88 | @echo " release_x86" 89 | @echo " debug_x64" 90 | @echo " debug_x86" 91 | @echo "" 92 | @echo "TARGETS:" 93 | @echo " all (default)" 94 | @echo " clean" 95 | @echo " nfd" 96 | @echo " test_pickfolder" 97 | @echo " test_opendialog" 98 | @echo " test_opendialogmultiple" 99 | @echo " test_savedialog" 100 | @echo "" 101 | @echo "For more information, see https://github.com/premake/premake-core/wiki" -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/nfd.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../lib/Release/x64 16 | TARGET = $(TARGETDIR)/libnfd.a 17 | OBJDIR = ../obj/x64/Release/nfd 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += 26 | LDDEPS += 27 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s 28 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../lib/Release/x86 43 | TARGET = $(TARGETDIR)/libnfd.a 44 | OBJDIR = ../obj/x86/Release/nfd 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += 53 | LDDEPS += 54 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s 55 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../lib/Debug/x64 70 | TARGET = $(TARGETDIR)/libnfd_d.a 71 | OBJDIR = ../obj/x64/Debug/nfd 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 82 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../lib/Debug/x86 97 | TARGET = $(TARGETDIR)/libnfd_d.a 98 | OBJDIR = ../obj/x86/Debug/nfd 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions `pkg-config --cflags gtk+-3.0` 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 109 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/nfd_common.o \ 123 | $(OBJDIR)/nfd_gtk.o \ 124 | 125 | RESOURCES := \ 126 | 127 | CUSTOMFILES := \ 128 | 129 | SHELLTYPE := posix 130 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 131 | SHELLTYPE := msdos 132 | endif 133 | 134 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 135 | @echo Linking nfd 136 | $(SILENT) $(LINKCMD) 137 | $(POSTBUILDCMDS) 138 | 139 | $(CUSTOMFILES): | $(OBJDIR) 140 | 141 | $(TARGETDIR): 142 | @echo Creating $(TARGETDIR) 143 | ifeq (posix,$(SHELLTYPE)) 144 | $(SILENT) mkdir -p $(TARGETDIR) 145 | else 146 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 147 | endif 148 | 149 | $(OBJDIR): 150 | @echo Creating $(OBJDIR) 151 | ifeq (posix,$(SHELLTYPE)) 152 | $(SILENT) mkdir -p $(OBJDIR) 153 | else 154 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 155 | endif 156 | 157 | clean: 158 | @echo Cleaning nfd 159 | ifeq (posix,$(SHELLTYPE)) 160 | $(SILENT) rm -f $(TARGET) 161 | $(SILENT) rm -rf $(OBJDIR) 162 | else 163 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 164 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 165 | endif 166 | 167 | prebuild: 168 | $(PREBUILDCMDS) 169 | 170 | prelink: 171 | $(PRELINKCMDS) 172 | 173 | ifneq (,$(PCH)) 174 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 175 | $(GCH): $(PCH) | $(OBJDIR) 176 | @echo $(notdir $<) 177 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 178 | else 179 | $(OBJECTS): | $(OBJDIR) 180 | endif 181 | 182 | $(OBJDIR)/nfd_common.o: ../../src/nfd_common.c 183 | @echo $(notdir $<) 184 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 185 | $(OBJDIR)/nfd_gtk.o: ../../src/nfd_gtk.c 186 | @echo $(notdir $<) 187 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 188 | 189 | -include $(OBJECTS:%.o=%.d) 190 | ifneq (,$(PCH)) 191 | -include $(OBJDIR)/$(notdir $(PCH)).d 192 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/test_opendialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialog 17 | OBJDIR = ../obj/x64/Release/test_opendialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd `pkg-config --libs gtk+-3.0` 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialog 44 | OBJDIR = ../obj/x86/Release/test_opendialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd `pkg-config --libs gtk+-3.0` 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialog_d 71 | OBJDIR = ../obj/x64/Debug/test_opendialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d `pkg-config --libs gtk+-3.0` 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialog_d 98 | OBJDIR = ../obj/x86/Debug/test_opendialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d `pkg-config --libs gtk+-3.0` 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialog.o: ../../test/test_opendialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/test_opendialogmultiple.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialogmultiple 17 | OBJDIR = ../obj/x64/Release/test_opendialogmultiple 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd `pkg-config --libs gtk+-3.0` 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialogmultiple 44 | OBJDIR = ../obj/x86/Release/test_opendialogmultiple 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd `pkg-config --libs gtk+-3.0` 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d 71 | OBJDIR = ../obj/x64/Debug/test_opendialogmultiple 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d `pkg-config --libs gtk+-3.0` 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d 98 | OBJDIR = ../obj/x86/Debug/test_opendialogmultiple 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d `pkg-config --libs gtk+-3.0` 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialogmultiple.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialogmultiple 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialogmultiple 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialogmultiple.o: ../../test/test_opendialogmultiple.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/test_pickfolder.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_pickfolder 17 | OBJDIR = ../obj/x64/Release/test_pickfolder 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd `pkg-config --libs gtk+-3.0` 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_pickfolder 44 | OBJDIR = ../obj/x86/Release/test_pickfolder 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd `pkg-config --libs gtk+-3.0` 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_pickfolder_d 71 | OBJDIR = ../obj/x64/Debug/test_pickfolder 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d `pkg-config --libs gtk+-3.0` 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_pickfolder_d 98 | OBJDIR = ../obj/x86/Debug/test_pickfolder 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d `pkg-config --libs gtk+-3.0` 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_pickfolder.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_pickfolder 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_pickfolder 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_pickfolder.o: ../../test/test_pickfolder.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux/test_savedialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_savedialog 17 | OBJDIR = ../obj/x64/Release/test_savedialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd `pkg-config --libs gtk+-3.0` 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_savedialog 44 | OBJDIR = ../obj/x86/Release/test_savedialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd `pkg-config --libs gtk+-3.0` 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_savedialog_d 71 | OBJDIR = ../obj/x64/Debug/test_savedialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d `pkg-config --libs gtk+-3.0` 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_savedialog_d 98 | OBJDIR = ../obj/x86/Debug/test_savedialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d `pkg-config --libs gtk+-3.0` 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_savedialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_savedialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_savedialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_savedialog.o: ../../test/test_savedialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/Makefile: -------------------------------------------------------------------------------- 1 | # GNU Make workspace makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | ifeq ($(config),release_x64) 12 | nfd_config = release_x64 13 | test_pickfolder_config = release_x64 14 | test_opendialog_config = release_x64 15 | test_opendialogmultiple_config = release_x64 16 | test_savedialog_config = release_x64 17 | endif 18 | ifeq ($(config),release_x86) 19 | nfd_config = release_x86 20 | test_pickfolder_config = release_x86 21 | test_opendialog_config = release_x86 22 | test_opendialogmultiple_config = release_x86 23 | test_savedialog_config = release_x86 24 | endif 25 | ifeq ($(config),debug_x64) 26 | nfd_config = debug_x64 27 | test_pickfolder_config = debug_x64 28 | test_opendialog_config = debug_x64 29 | test_opendialogmultiple_config = debug_x64 30 | test_savedialog_config = debug_x64 31 | endif 32 | ifeq ($(config),debug_x86) 33 | nfd_config = debug_x86 34 | test_pickfolder_config = debug_x86 35 | test_opendialog_config = debug_x86 36 | test_opendialogmultiple_config = debug_x86 37 | test_savedialog_config = debug_x86 38 | endif 39 | 40 | PROJECTS := nfd test_pickfolder test_opendialog test_opendialogmultiple test_savedialog 41 | 42 | .PHONY: all clean help $(PROJECTS) 43 | 44 | all: $(PROJECTS) 45 | 46 | nfd: 47 | ifneq (,$(nfd_config)) 48 | @echo "==== Building nfd ($(nfd_config)) ====" 49 | @${MAKE} --no-print-directory -C . -f nfd.make config=$(nfd_config) 50 | endif 51 | 52 | test_pickfolder: nfd 53 | ifneq (,$(test_pickfolder_config)) 54 | @echo "==== Building test_pickfolder ($(test_pickfolder_config)) ====" 55 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make config=$(test_pickfolder_config) 56 | endif 57 | 58 | test_opendialog: nfd 59 | ifneq (,$(test_opendialog_config)) 60 | @echo "==== Building test_opendialog ($(test_opendialog_config)) ====" 61 | @${MAKE} --no-print-directory -C . -f test_opendialog.make config=$(test_opendialog_config) 62 | endif 63 | 64 | test_opendialogmultiple: nfd 65 | ifneq (,$(test_opendialogmultiple_config)) 66 | @echo "==== Building test_opendialogmultiple ($(test_opendialogmultiple_config)) ====" 67 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make config=$(test_opendialogmultiple_config) 68 | endif 69 | 70 | test_savedialog: nfd 71 | ifneq (,$(test_savedialog_config)) 72 | @echo "==== Building test_savedialog ($(test_savedialog_config)) ====" 73 | @${MAKE} --no-print-directory -C . -f test_savedialog.make config=$(test_savedialog_config) 74 | endif 75 | 76 | clean: 77 | @${MAKE} --no-print-directory -C . -f nfd.make clean 78 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make clean 79 | @${MAKE} --no-print-directory -C . -f test_opendialog.make clean 80 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make clean 81 | @${MAKE} --no-print-directory -C . -f test_savedialog.make clean 82 | 83 | help: 84 | @echo "Usage: make [config=name] [target]" 85 | @echo "" 86 | @echo "CONFIGURATIONS:" 87 | @echo " release_x64" 88 | @echo " release_x86" 89 | @echo " debug_x64" 90 | @echo " debug_x86" 91 | @echo "" 92 | @echo "TARGETS:" 93 | @echo " all (default)" 94 | @echo " clean" 95 | @echo " nfd" 96 | @echo " test_pickfolder" 97 | @echo " test_opendialog" 98 | @echo " test_opendialogmultiple" 99 | @echo " test_savedialog" 100 | @echo "" 101 | @echo "For more information, see https://github.com/premake/premake-core/wiki" -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/nfd.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../lib/Release/x64 16 | TARGET = $(TARGETDIR)/libnfd.a 17 | OBJDIR = ../obj/x64/Release/nfd 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += 26 | LDDEPS += 27 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s 28 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../lib/Release/x86 43 | TARGET = $(TARGETDIR)/libnfd.a 44 | OBJDIR = ../obj/x86/Release/nfd 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += 53 | LDDEPS += 54 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s 55 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../lib/Debug/x64 70 | TARGET = $(TARGETDIR)/libnfd_d.a 71 | OBJDIR = ../obj/x64/Debug/nfd 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 82 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../lib/Debug/x86 97 | TARGET = $(TARGETDIR)/libnfd_d.a 98 | OBJDIR = ../obj/x86/Debug/nfd 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 109 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/nfd_common.o \ 123 | $(OBJDIR)/nfd_zenity.o \ 124 | 125 | RESOURCES := \ 126 | 127 | CUSTOMFILES := \ 128 | 129 | SHELLTYPE := posix 130 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 131 | SHELLTYPE := msdos 132 | endif 133 | 134 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 135 | @echo Linking nfd 136 | $(SILENT) $(LINKCMD) 137 | $(POSTBUILDCMDS) 138 | 139 | $(CUSTOMFILES): | $(OBJDIR) 140 | 141 | $(TARGETDIR): 142 | @echo Creating $(TARGETDIR) 143 | ifeq (posix,$(SHELLTYPE)) 144 | $(SILENT) mkdir -p $(TARGETDIR) 145 | else 146 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 147 | endif 148 | 149 | $(OBJDIR): 150 | @echo Creating $(OBJDIR) 151 | ifeq (posix,$(SHELLTYPE)) 152 | $(SILENT) mkdir -p $(OBJDIR) 153 | else 154 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 155 | endif 156 | 157 | clean: 158 | @echo Cleaning nfd 159 | ifeq (posix,$(SHELLTYPE)) 160 | $(SILENT) rm -f $(TARGET) 161 | $(SILENT) rm -rf $(OBJDIR) 162 | else 163 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 164 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 165 | endif 166 | 167 | prebuild: 168 | $(PREBUILDCMDS) 169 | 170 | prelink: 171 | $(PRELINKCMDS) 172 | 173 | ifneq (,$(PCH)) 174 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 175 | $(GCH): $(PCH) | $(OBJDIR) 176 | @echo $(notdir $<) 177 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 178 | else 179 | $(OBJECTS): | $(OBJDIR) 180 | endif 181 | 182 | $(OBJDIR)/nfd_common.o: ../../src/nfd_common.c 183 | @echo $(notdir $<) 184 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 185 | $(OBJDIR)/nfd_zenity.o: ../../src/nfd_zenity.c 186 | @echo $(notdir $<) 187 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 188 | 189 | -include $(OBJECTS:%.o=%.d) 190 | ifneq (,$(PCH)) 191 | -include $(OBJDIR)/$(notdir $(PCH)).d 192 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/test_opendialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialog 17 | OBJDIR = ../obj/x64/Release/test_opendialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialog 44 | OBJDIR = ../obj/x86/Release/test_opendialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialog_d 71 | OBJDIR = ../obj/x64/Debug/test_opendialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialog_d 98 | OBJDIR = ../obj/x86/Debug/test_opendialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialog.o: ../../test/test_opendialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/test_opendialogmultiple.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialogmultiple 17 | OBJDIR = ../obj/x64/Release/test_opendialogmultiple 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialogmultiple 44 | OBJDIR = ../obj/x86/Release/test_opendialogmultiple 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d 71 | OBJDIR = ../obj/x64/Debug/test_opendialogmultiple 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d 98 | OBJDIR = ../obj/x86/Debug/test_opendialogmultiple 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialogmultiple.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialogmultiple 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialogmultiple 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialogmultiple.o: ../../test/test_opendialogmultiple.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/test_pickfolder.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_pickfolder 17 | OBJDIR = ../obj/x64/Release/test_pickfolder 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_pickfolder 44 | OBJDIR = ../obj/x86/Release/test_pickfolder 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_pickfolder_d 71 | OBJDIR = ../obj/x64/Debug/test_pickfolder 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_pickfolder_d 98 | OBJDIR = ../obj/x86/Debug/test_pickfolder 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_pickfolder.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_pickfolder 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_pickfolder 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_pickfolder.o: ../../test/test_pickfolder.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_linux_zenity/test_savedialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_savedialog 17 | OBJDIR = ../obj/x64/Release/test_savedialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/libnfd.a 26 | LDDEPS += ../lib/Release/x64/libnfd.a 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s -lnfd 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_savedialog 44 | OBJDIR = ../obj/x86/Release/test_savedialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/libnfd.a 53 | LDDEPS += ../lib/Release/x86/libnfd.a 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s -lnfd 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_savedialog_d 71 | OBJDIR = ../obj/x64/Debug/test_savedialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 -lnfd_d 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_savedialog_d 98 | OBJDIR = ../obj/x86/Debug/test_savedialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 -lnfd_d 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_savedialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_savedialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_savedialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_savedialog.o: ../../test/test_savedialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/Makefile: -------------------------------------------------------------------------------- 1 | # GNU Make workspace makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | ifeq ($(config),release_x64) 12 | nfd_config = release_x64 13 | test_pickfolder_config = release_x64 14 | test_opendialog_config = release_x64 15 | test_opendialogmultiple_config = release_x64 16 | test_savedialog_config = release_x64 17 | endif 18 | ifeq ($(config),debug_x64) 19 | nfd_config = debug_x64 20 | test_pickfolder_config = debug_x64 21 | test_opendialog_config = debug_x64 22 | test_opendialogmultiple_config = debug_x64 23 | test_savedialog_config = debug_x64 24 | endif 25 | 26 | PROJECTS := nfd test_pickfolder test_opendialog test_opendialogmultiple test_savedialog 27 | 28 | .PHONY: all clean help $(PROJECTS) 29 | 30 | all: $(PROJECTS) 31 | 32 | nfd: 33 | ifneq (,$(nfd_config)) 34 | @echo "==== Building nfd ($(nfd_config)) ====" 35 | @${MAKE} --no-print-directory -C . -f nfd.make config=$(nfd_config) 36 | endif 37 | 38 | test_pickfolder: nfd 39 | ifneq (,$(test_pickfolder_config)) 40 | @echo "==== Building test_pickfolder ($(test_pickfolder_config)) ====" 41 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make config=$(test_pickfolder_config) 42 | endif 43 | 44 | test_opendialog: nfd 45 | ifneq (,$(test_opendialog_config)) 46 | @echo "==== Building test_opendialog ($(test_opendialog_config)) ====" 47 | @${MAKE} --no-print-directory -C . -f test_opendialog.make config=$(test_opendialog_config) 48 | endif 49 | 50 | test_opendialogmultiple: nfd 51 | ifneq (,$(test_opendialogmultiple_config)) 52 | @echo "==== Building test_opendialogmultiple ($(test_opendialogmultiple_config)) ====" 53 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make config=$(test_opendialogmultiple_config) 54 | endif 55 | 56 | test_savedialog: nfd 57 | ifneq (,$(test_savedialog_config)) 58 | @echo "==== Building test_savedialog ($(test_savedialog_config)) ====" 59 | @${MAKE} --no-print-directory -C . -f test_savedialog.make config=$(test_savedialog_config) 60 | endif 61 | 62 | clean: 63 | @${MAKE} --no-print-directory -C . -f nfd.make clean 64 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make clean 65 | @${MAKE} --no-print-directory -C . -f test_opendialog.make clean 66 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make clean 67 | @${MAKE} --no-print-directory -C . -f test_savedialog.make clean 68 | 69 | help: 70 | @echo "Usage: make [config=name] [target]" 71 | @echo "" 72 | @echo "CONFIGURATIONS:" 73 | @echo " release_x64" 74 | @echo " debug_x64" 75 | @echo "" 76 | @echo "TARGETS:" 77 | @echo " all (default)" 78 | @echo " clean" 79 | @echo " nfd" 80 | @echo " test_pickfolder" 81 | @echo " test_opendialog" 82 | @echo " test_opendialogmultiple" 83 | @echo " test_savedialog" 84 | @echo "" 85 | @echo "For more information, see https://github.com/premake/premake-core/wiki" -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/nfd.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | ifeq ($(origin CC), default) 15 | CC = clang 16 | endif 17 | ifeq ($(origin CXX), default) 18 | CXX = clang++ 19 | endif 20 | ifeq ($(origin AR), default) 21 | AR = ar 22 | endif 23 | TARGETDIR = ../lib/Release/x64 24 | TARGET = $(TARGETDIR)/libnfd.a 25 | OBJDIR = obj/x64/Release/nfd 26 | DEFINES += -DNDEBUG 27 | INCLUDES += -I../../src/include 28 | FORCE_INCLUDE += 29 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 30 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 31 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 32 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 33 | LIBS += 34 | LDDEPS += 35 | ALL_LDFLAGS += $(LDFLAGS) -m64 36 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 37 | define PREBUILDCMDS 38 | endef 39 | define PRELINKCMDS 40 | endef 41 | define POSTBUILDCMDS 42 | endef 43 | all: prebuild prelink $(TARGET) 44 | @: 45 | 46 | endif 47 | 48 | ifeq ($(config),debug_x64) 49 | ifeq ($(origin CC), default) 50 | CC = clang 51 | endif 52 | ifeq ($(origin CXX), default) 53 | CXX = clang++ 54 | endif 55 | ifeq ($(origin AR), default) 56 | AR = ar 57 | endif 58 | TARGETDIR = ../lib/Debug/x64 59 | TARGET = $(TARGETDIR)/libnfd_d.a 60 | OBJDIR = obj/x64/Debug/nfd 61 | DEFINES += -DDEBUG 62 | INCLUDES += -I../../src/include 63 | FORCE_INCLUDE += 64 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 65 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 66 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 67 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 68 | LIBS += 69 | LDDEPS += 70 | ALL_LDFLAGS += $(LDFLAGS) -m64 71 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 72 | define PREBUILDCMDS 73 | endef 74 | define PRELINKCMDS 75 | endef 76 | define POSTBUILDCMDS 77 | endef 78 | all: prebuild prelink $(TARGET) 79 | @: 80 | 81 | endif 82 | 83 | OBJECTS := \ 84 | $(OBJDIR)/nfd_cocoa.o \ 85 | $(OBJDIR)/nfd_common.o \ 86 | 87 | RESOURCES := \ 88 | 89 | CUSTOMFILES := \ 90 | 91 | SHELLTYPE := posix 92 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 93 | SHELLTYPE := msdos 94 | endif 95 | 96 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 97 | @echo Linking nfd 98 | $(SILENT) $(LINKCMD) 99 | $(POSTBUILDCMDS) 100 | 101 | $(CUSTOMFILES): | $(OBJDIR) 102 | 103 | $(TARGETDIR): 104 | @echo Creating $(TARGETDIR) 105 | ifeq (posix,$(SHELLTYPE)) 106 | $(SILENT) mkdir -p $(TARGETDIR) 107 | else 108 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 109 | endif 110 | 111 | $(OBJDIR): 112 | @echo Creating $(OBJDIR) 113 | ifeq (posix,$(SHELLTYPE)) 114 | $(SILENT) mkdir -p $(OBJDIR) 115 | else 116 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 117 | endif 118 | 119 | clean: 120 | @echo Cleaning nfd 121 | ifeq (posix,$(SHELLTYPE)) 122 | $(SILENT) rm -f $(TARGET) 123 | $(SILENT) rm -rf $(OBJDIR) 124 | else 125 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 126 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 127 | endif 128 | 129 | prebuild: 130 | $(PREBUILDCMDS) 131 | 132 | prelink: 133 | $(PRELINKCMDS) 134 | 135 | ifneq (,$(PCH)) 136 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 137 | $(GCH): $(PCH) | $(OBJDIR) 138 | @echo $(notdir $<) 139 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 140 | else 141 | $(OBJECTS): | $(OBJDIR) 142 | endif 143 | 144 | $(OBJDIR)/nfd_cocoa.o: ../../src/nfd_cocoa.m 145 | @echo $(notdir $<) 146 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 147 | $(OBJDIR)/nfd_common.o: ../../src/nfd_common.c 148 | @echo $(notdir $<) 149 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 150 | 151 | -include $(OBJECTS:%.o=%.d) 152 | ifneq (,$(PCH)) 153 | -include $(OBJDIR)/$(notdir $(PCH)).d 154 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/test_opendialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | ifeq ($(origin CC), default) 15 | CC = clang 16 | endif 17 | ifeq ($(origin CXX), default) 18 | CXX = clang++ 19 | endif 20 | ifeq ($(origin AR), default) 21 | AR = ar 22 | endif 23 | TARGETDIR = ../bin 24 | TARGET = $(TARGETDIR)/test_opendialog 25 | OBJDIR = obj/x64/Release/test_opendialog 26 | DEFINES += -DNDEBUG 27 | INCLUDES += -I../../src/include 28 | FORCE_INCLUDE += 29 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 30 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 31 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 32 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 33 | LIBS += ../lib/Release/x64/libnfd.a -framework Foundation -framework AppKit 34 | LDDEPS += ../lib/Release/x64/libnfd.a 35 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -m64 36 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 37 | define PREBUILDCMDS 38 | endef 39 | define PRELINKCMDS 40 | endef 41 | define POSTBUILDCMDS 42 | endef 43 | all: prebuild prelink $(TARGET) 44 | @: 45 | 46 | endif 47 | 48 | ifeq ($(config),debug_x64) 49 | ifeq ($(origin CC), default) 50 | CC = clang 51 | endif 52 | ifeq ($(origin CXX), default) 53 | CXX = clang++ 54 | endif 55 | ifeq ($(origin AR), default) 56 | AR = ar 57 | endif 58 | TARGETDIR = ../bin 59 | TARGET = $(TARGETDIR)/test_opendialog_d 60 | OBJDIR = obj/x64/Debug/test_opendialog 61 | DEFINES += -DDEBUG 62 | INCLUDES += -I../../src/include 63 | FORCE_INCLUDE += 64 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 65 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 66 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 67 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 68 | LIBS += -framework Foundation -framework AppKit -lnfd_d 69 | LDDEPS += 70 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -m64 71 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 72 | define PREBUILDCMDS 73 | endef 74 | define PRELINKCMDS 75 | endef 76 | define POSTBUILDCMDS 77 | endef 78 | all: prebuild prelink $(TARGET) 79 | @: 80 | 81 | endif 82 | 83 | OBJECTS := \ 84 | $(OBJDIR)/test_opendialog.o \ 85 | 86 | RESOURCES := \ 87 | 88 | CUSTOMFILES := \ 89 | 90 | SHELLTYPE := posix 91 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 92 | SHELLTYPE := msdos 93 | endif 94 | 95 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 96 | @echo Linking test_opendialog 97 | $(SILENT) $(LINKCMD) 98 | $(POSTBUILDCMDS) 99 | 100 | $(CUSTOMFILES): | $(OBJDIR) 101 | 102 | $(TARGETDIR): 103 | @echo Creating $(TARGETDIR) 104 | ifeq (posix,$(SHELLTYPE)) 105 | $(SILENT) mkdir -p $(TARGETDIR) 106 | else 107 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 108 | endif 109 | 110 | $(OBJDIR): 111 | @echo Creating $(OBJDIR) 112 | ifeq (posix,$(SHELLTYPE)) 113 | $(SILENT) mkdir -p $(OBJDIR) 114 | else 115 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 116 | endif 117 | 118 | clean: 119 | @echo Cleaning test_opendialog 120 | ifeq (posix,$(SHELLTYPE)) 121 | $(SILENT) rm -f $(TARGET) 122 | $(SILENT) rm -rf $(OBJDIR) 123 | else 124 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 125 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 126 | endif 127 | 128 | prebuild: 129 | $(PREBUILDCMDS) 130 | 131 | prelink: 132 | $(PRELINKCMDS) 133 | 134 | ifneq (,$(PCH)) 135 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 136 | $(GCH): $(PCH) | $(OBJDIR) 137 | @echo $(notdir $<) 138 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 139 | else 140 | $(OBJECTS): | $(OBJDIR) 141 | endif 142 | 143 | $(OBJDIR)/test_opendialog.o: ../../test/test_opendialog.c 144 | @echo $(notdir $<) 145 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 146 | 147 | -include $(OBJECTS:%.o=%.d) 148 | ifneq (,$(PCH)) 149 | -include $(OBJDIR)/$(notdir $(PCH)).d 150 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/test_opendialogmultiple.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | ifeq ($(origin CC), default) 15 | CC = clang 16 | endif 17 | ifeq ($(origin CXX), default) 18 | CXX = clang++ 19 | endif 20 | ifeq ($(origin AR), default) 21 | AR = ar 22 | endif 23 | TARGETDIR = ../bin 24 | TARGET = $(TARGETDIR)/test_opendialogmultiple 25 | OBJDIR = obj/x64/Release/test_opendialogmultiple 26 | DEFINES += -DNDEBUG 27 | INCLUDES += -I../../src/include 28 | FORCE_INCLUDE += 29 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 30 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 31 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 32 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 33 | LIBS += ../lib/Release/x64/libnfd.a -framework Foundation -framework AppKit 34 | LDDEPS += ../lib/Release/x64/libnfd.a 35 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -m64 36 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 37 | define PREBUILDCMDS 38 | endef 39 | define PRELINKCMDS 40 | endef 41 | define POSTBUILDCMDS 42 | endef 43 | all: prebuild prelink $(TARGET) 44 | @: 45 | 46 | endif 47 | 48 | ifeq ($(config),debug_x64) 49 | ifeq ($(origin CC), default) 50 | CC = clang 51 | endif 52 | ifeq ($(origin CXX), default) 53 | CXX = clang++ 54 | endif 55 | ifeq ($(origin AR), default) 56 | AR = ar 57 | endif 58 | TARGETDIR = ../bin 59 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d 60 | OBJDIR = obj/x64/Debug/test_opendialogmultiple 61 | DEFINES += -DDEBUG 62 | INCLUDES += -I../../src/include 63 | FORCE_INCLUDE += 64 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 65 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 66 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 67 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 68 | LIBS += -framework Foundation -framework AppKit -lnfd_d 69 | LDDEPS += 70 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -m64 71 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 72 | define PREBUILDCMDS 73 | endef 74 | define PRELINKCMDS 75 | endef 76 | define POSTBUILDCMDS 77 | endef 78 | all: prebuild prelink $(TARGET) 79 | @: 80 | 81 | endif 82 | 83 | OBJECTS := \ 84 | $(OBJDIR)/test_opendialogmultiple.o \ 85 | 86 | RESOURCES := \ 87 | 88 | CUSTOMFILES := \ 89 | 90 | SHELLTYPE := posix 91 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 92 | SHELLTYPE := msdos 93 | endif 94 | 95 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 96 | @echo Linking test_opendialogmultiple 97 | $(SILENT) $(LINKCMD) 98 | $(POSTBUILDCMDS) 99 | 100 | $(CUSTOMFILES): | $(OBJDIR) 101 | 102 | $(TARGETDIR): 103 | @echo Creating $(TARGETDIR) 104 | ifeq (posix,$(SHELLTYPE)) 105 | $(SILENT) mkdir -p $(TARGETDIR) 106 | else 107 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 108 | endif 109 | 110 | $(OBJDIR): 111 | @echo Creating $(OBJDIR) 112 | ifeq (posix,$(SHELLTYPE)) 113 | $(SILENT) mkdir -p $(OBJDIR) 114 | else 115 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 116 | endif 117 | 118 | clean: 119 | @echo Cleaning test_opendialogmultiple 120 | ifeq (posix,$(SHELLTYPE)) 121 | $(SILENT) rm -f $(TARGET) 122 | $(SILENT) rm -rf $(OBJDIR) 123 | else 124 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 125 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 126 | endif 127 | 128 | prebuild: 129 | $(PREBUILDCMDS) 130 | 131 | prelink: 132 | $(PRELINKCMDS) 133 | 134 | ifneq (,$(PCH)) 135 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 136 | $(GCH): $(PCH) | $(OBJDIR) 137 | @echo $(notdir $<) 138 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 139 | else 140 | $(OBJECTS): | $(OBJDIR) 141 | endif 142 | 143 | $(OBJDIR)/test_opendialogmultiple.o: ../../test/test_opendialogmultiple.c 144 | @echo $(notdir $<) 145 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 146 | 147 | -include $(OBJECTS:%.o=%.d) 148 | ifneq (,$(PCH)) 149 | -include $(OBJDIR)/$(notdir $(PCH)).d 150 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/test_pickfolder.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | ifeq ($(origin CC), default) 15 | CC = clang 16 | endif 17 | ifeq ($(origin CXX), default) 18 | CXX = clang++ 19 | endif 20 | ifeq ($(origin AR), default) 21 | AR = ar 22 | endif 23 | TARGETDIR = ../bin 24 | TARGET = $(TARGETDIR)/test_pickfolder 25 | OBJDIR = obj/x64/Release/test_pickfolder 26 | DEFINES += -DNDEBUG 27 | INCLUDES += -I../../src/include 28 | FORCE_INCLUDE += 29 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 30 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 31 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 32 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 33 | LIBS += ../lib/Release/x64/libnfd.a -framework Foundation -framework AppKit 34 | LDDEPS += ../lib/Release/x64/libnfd.a 35 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -m64 36 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 37 | define PREBUILDCMDS 38 | endef 39 | define PRELINKCMDS 40 | endef 41 | define POSTBUILDCMDS 42 | endef 43 | all: prebuild prelink $(TARGET) 44 | @: 45 | 46 | endif 47 | 48 | ifeq ($(config),debug_x64) 49 | ifeq ($(origin CC), default) 50 | CC = clang 51 | endif 52 | ifeq ($(origin CXX), default) 53 | CXX = clang++ 54 | endif 55 | ifeq ($(origin AR), default) 56 | AR = ar 57 | endif 58 | TARGETDIR = ../bin 59 | TARGET = $(TARGETDIR)/test_pickfolder_d 60 | OBJDIR = obj/x64/Debug/test_pickfolder 61 | DEFINES += -DDEBUG 62 | INCLUDES += -I../../src/include 63 | FORCE_INCLUDE += 64 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 65 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 66 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 67 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 68 | LIBS += -framework Foundation -framework AppKit -lnfd_d 69 | LDDEPS += 70 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -m64 71 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 72 | define PREBUILDCMDS 73 | endef 74 | define PRELINKCMDS 75 | endef 76 | define POSTBUILDCMDS 77 | endef 78 | all: prebuild prelink $(TARGET) 79 | @: 80 | 81 | endif 82 | 83 | OBJECTS := \ 84 | $(OBJDIR)/test_pickfolder.o \ 85 | 86 | RESOURCES := \ 87 | 88 | CUSTOMFILES := \ 89 | 90 | SHELLTYPE := posix 91 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 92 | SHELLTYPE := msdos 93 | endif 94 | 95 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 96 | @echo Linking test_pickfolder 97 | $(SILENT) $(LINKCMD) 98 | $(POSTBUILDCMDS) 99 | 100 | $(CUSTOMFILES): | $(OBJDIR) 101 | 102 | $(TARGETDIR): 103 | @echo Creating $(TARGETDIR) 104 | ifeq (posix,$(SHELLTYPE)) 105 | $(SILENT) mkdir -p $(TARGETDIR) 106 | else 107 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 108 | endif 109 | 110 | $(OBJDIR): 111 | @echo Creating $(OBJDIR) 112 | ifeq (posix,$(SHELLTYPE)) 113 | $(SILENT) mkdir -p $(OBJDIR) 114 | else 115 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 116 | endif 117 | 118 | clean: 119 | @echo Cleaning test_pickfolder 120 | ifeq (posix,$(SHELLTYPE)) 121 | $(SILENT) rm -f $(TARGET) 122 | $(SILENT) rm -rf $(OBJDIR) 123 | else 124 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 125 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 126 | endif 127 | 128 | prebuild: 129 | $(PREBUILDCMDS) 130 | 131 | prelink: 132 | $(PRELINKCMDS) 133 | 134 | ifneq (,$(PCH)) 135 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 136 | $(GCH): $(PCH) | $(OBJDIR) 137 | @echo $(notdir $<) 138 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 139 | else 140 | $(OBJECTS): | $(OBJDIR) 141 | endif 142 | 143 | $(OBJDIR)/test_pickfolder.o: ../../test/test_pickfolder.c 144 | @echo $(notdir $<) 145 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 146 | 147 | -include $(OBJECTS:%.o=%.d) 148 | ifneq (,$(PCH)) 149 | -include $(OBJDIR)/$(notdir $(PCH)).d 150 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_macosx/test_savedialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | ifeq ($(origin CC), default) 15 | CC = clang 16 | endif 17 | ifeq ($(origin CXX), default) 18 | CXX = clang++ 19 | endif 20 | ifeq ($(origin AR), default) 21 | AR = ar 22 | endif 23 | TARGETDIR = ../bin 24 | TARGET = $(TARGETDIR)/test_savedialog 25 | OBJDIR = obj/x64/Release/test_savedialog 26 | DEFINES += -DNDEBUG 27 | INCLUDES += -I../../src/include 28 | FORCE_INCLUDE += 29 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 30 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 31 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 32 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 33 | LIBS += ../lib/Release/x64/libnfd.a -framework Foundation -framework AppKit 34 | LDDEPS += ../lib/Release/x64/libnfd.a 35 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -m64 36 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 37 | define PREBUILDCMDS 38 | endef 39 | define PRELINKCMDS 40 | endef 41 | define POSTBUILDCMDS 42 | endef 43 | all: prebuild prelink $(TARGET) 44 | @: 45 | 46 | endif 47 | 48 | ifeq ($(config),debug_x64) 49 | ifeq ($(origin CC), default) 50 | CC = clang 51 | endif 52 | ifeq ($(origin CXX), default) 53 | CXX = clang++ 54 | endif 55 | ifeq ($(origin AR), default) 56 | AR = ar 57 | endif 58 | TARGETDIR = ../bin 59 | TARGET = $(TARGETDIR)/test_savedialog_d 60 | OBJDIR = obj/x64/Debug/test_savedialog 61 | DEFINES += -DDEBUG 62 | INCLUDES += -I../../src/include 63 | FORCE_INCLUDE += 64 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 65 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 66 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 67 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 68 | LIBS += -framework Foundation -framework AppKit -lnfd_d 69 | LDDEPS += 70 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -m64 71 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 72 | define PREBUILDCMDS 73 | endef 74 | define PRELINKCMDS 75 | endef 76 | define POSTBUILDCMDS 77 | endef 78 | all: prebuild prelink $(TARGET) 79 | @: 80 | 81 | endif 82 | 83 | OBJECTS := \ 84 | $(OBJDIR)/test_savedialog.o \ 85 | 86 | RESOURCES := \ 87 | 88 | CUSTOMFILES := \ 89 | 90 | SHELLTYPE := posix 91 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 92 | SHELLTYPE := msdos 93 | endif 94 | 95 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 96 | @echo Linking test_savedialog 97 | $(SILENT) $(LINKCMD) 98 | $(POSTBUILDCMDS) 99 | 100 | $(CUSTOMFILES): | $(OBJDIR) 101 | 102 | $(TARGETDIR): 103 | @echo Creating $(TARGETDIR) 104 | ifeq (posix,$(SHELLTYPE)) 105 | $(SILENT) mkdir -p $(TARGETDIR) 106 | else 107 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 108 | endif 109 | 110 | $(OBJDIR): 111 | @echo Creating $(OBJDIR) 112 | ifeq (posix,$(SHELLTYPE)) 113 | $(SILENT) mkdir -p $(OBJDIR) 114 | else 115 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 116 | endif 117 | 118 | clean: 119 | @echo Cleaning test_savedialog 120 | ifeq (posix,$(SHELLTYPE)) 121 | $(SILENT) rm -f $(TARGET) 122 | $(SILENT) rm -rf $(OBJDIR) 123 | else 124 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 125 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 126 | endif 127 | 128 | prebuild: 129 | $(PREBUILDCMDS) 130 | 131 | prelink: 132 | $(PRELINKCMDS) 133 | 134 | ifneq (,$(PCH)) 135 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 136 | $(GCH): $(PCH) | $(OBJDIR) 137 | @echo $(notdir $<) 138 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 139 | else 140 | $(OBJECTS): | $(OBJDIR) 141 | endif 142 | 143 | $(OBJDIR)/test_savedialog.o: ../../test/test_savedialog.c 144 | @echo $(notdir $<) 145 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 146 | 147 | -include $(OBJECTS:%.o=%.d) 148 | ifneq (,$(PCH)) 149 | -include $(OBJDIR)/$(notdir $(PCH)).d 150 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/Makefile: -------------------------------------------------------------------------------- 1 | # GNU Make workspace makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | ifeq ($(config),release_x64) 12 | nfd_config = release_x64 13 | test_pickfolder_config = release_x64 14 | test_opendialog_config = release_x64 15 | test_opendialogmultiple_config = release_x64 16 | test_savedialog_config = release_x64 17 | endif 18 | ifeq ($(config),release_x86) 19 | nfd_config = release_x86 20 | test_pickfolder_config = release_x86 21 | test_opendialog_config = release_x86 22 | test_opendialogmultiple_config = release_x86 23 | test_savedialog_config = release_x86 24 | endif 25 | ifeq ($(config),debug_x64) 26 | nfd_config = debug_x64 27 | test_pickfolder_config = debug_x64 28 | test_opendialog_config = debug_x64 29 | test_opendialogmultiple_config = debug_x64 30 | test_savedialog_config = debug_x64 31 | endif 32 | ifeq ($(config),debug_x86) 33 | nfd_config = debug_x86 34 | test_pickfolder_config = debug_x86 35 | test_opendialog_config = debug_x86 36 | test_opendialogmultiple_config = debug_x86 37 | test_savedialog_config = debug_x86 38 | endif 39 | 40 | PROJECTS := nfd test_pickfolder test_opendialog test_opendialogmultiple test_savedialog 41 | 42 | .PHONY: all clean help $(PROJECTS) 43 | 44 | all: $(PROJECTS) 45 | 46 | nfd: 47 | ifneq (,$(nfd_config)) 48 | @echo "==== Building nfd ($(nfd_config)) ====" 49 | @${MAKE} --no-print-directory -C . -f nfd.make config=$(nfd_config) 50 | endif 51 | 52 | test_pickfolder: nfd 53 | ifneq (,$(test_pickfolder_config)) 54 | @echo "==== Building test_pickfolder ($(test_pickfolder_config)) ====" 55 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make config=$(test_pickfolder_config) 56 | endif 57 | 58 | test_opendialog: nfd 59 | ifneq (,$(test_opendialog_config)) 60 | @echo "==== Building test_opendialog ($(test_opendialog_config)) ====" 61 | @${MAKE} --no-print-directory -C . -f test_opendialog.make config=$(test_opendialog_config) 62 | endif 63 | 64 | test_opendialogmultiple: nfd 65 | ifneq (,$(test_opendialogmultiple_config)) 66 | @echo "==== Building test_opendialogmultiple ($(test_opendialogmultiple_config)) ====" 67 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make config=$(test_opendialogmultiple_config) 68 | endif 69 | 70 | test_savedialog: nfd 71 | ifneq (,$(test_savedialog_config)) 72 | @echo "==== Building test_savedialog ($(test_savedialog_config)) ====" 73 | @${MAKE} --no-print-directory -C . -f test_savedialog.make config=$(test_savedialog_config) 74 | endif 75 | 76 | clean: 77 | @${MAKE} --no-print-directory -C . -f nfd.make clean 78 | @${MAKE} --no-print-directory -C . -f test_pickfolder.make clean 79 | @${MAKE} --no-print-directory -C . -f test_opendialog.make clean 80 | @${MAKE} --no-print-directory -C . -f test_opendialogmultiple.make clean 81 | @${MAKE} --no-print-directory -C . -f test_savedialog.make clean 82 | 83 | help: 84 | @echo "Usage: make [config=name] [target]" 85 | @echo "" 86 | @echo "CONFIGURATIONS:" 87 | @echo " release_x64" 88 | @echo " release_x86" 89 | @echo " debug_x64" 90 | @echo " debug_x86" 91 | @echo "" 92 | @echo "TARGETS:" 93 | @echo " all (default)" 94 | @echo " clean" 95 | @echo " nfd" 96 | @echo " test_pickfolder" 97 | @echo " test_opendialog" 98 | @echo " test_opendialogmultiple" 99 | @echo " test_savedialog" 100 | @echo "" 101 | @echo "For more information, see https://github.com/premake/premake-core/wiki" -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/nfd.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../lib/Release/x64 16 | TARGET = $(TARGETDIR)/nfd.lib 17 | OBJDIR = ../obj/x64/Release/nfd 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 -Wall -Wextra -fno-exceptions 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += 26 | LDDEPS += 27 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s 28 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../lib/Release/x86 43 | TARGET = $(TARGETDIR)/nfd.lib 44 | OBJDIR = ../obj/x86/Release/nfd 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 -Wall -Wextra -fno-exceptions 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += 53 | LDDEPS += 54 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s 55 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../lib/Debug/x64 70 | TARGET = $(TARGETDIR)/nfd_d.lib 71 | OBJDIR = ../obj/x64/Debug/nfd 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g -Wall -Wextra -fno-exceptions 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 82 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../lib/Debug/x86 97 | TARGET = $(TARGETDIR)/nfd_d.lib 98 | OBJDIR = ../obj/x86/Debug/nfd 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g -Wall -Wextra -fno-exceptions 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 109 | LINKCMD = $(AR) -rcs "$@" $(OBJECTS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/nfd_common.o \ 123 | $(OBJDIR)/nfd_win.o \ 124 | 125 | RESOURCES := \ 126 | 127 | CUSTOMFILES := \ 128 | 129 | SHELLTYPE := posix 130 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 131 | SHELLTYPE := msdos 132 | endif 133 | 134 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 135 | @echo Linking nfd 136 | $(SILENT) $(LINKCMD) 137 | $(POSTBUILDCMDS) 138 | 139 | $(CUSTOMFILES): | $(OBJDIR) 140 | 141 | $(TARGETDIR): 142 | @echo Creating $(TARGETDIR) 143 | ifeq (posix,$(SHELLTYPE)) 144 | $(SILENT) mkdir -p $(TARGETDIR) 145 | else 146 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 147 | endif 148 | 149 | $(OBJDIR): 150 | @echo Creating $(OBJDIR) 151 | ifeq (posix,$(SHELLTYPE)) 152 | $(SILENT) mkdir -p $(OBJDIR) 153 | else 154 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 155 | endif 156 | 157 | clean: 158 | @echo Cleaning nfd 159 | ifeq (posix,$(SHELLTYPE)) 160 | $(SILENT) rm -f $(TARGET) 161 | $(SILENT) rm -rf $(OBJDIR) 162 | else 163 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 164 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 165 | endif 166 | 167 | prebuild: 168 | $(PREBUILDCMDS) 169 | 170 | prelink: 171 | $(PRELINKCMDS) 172 | 173 | ifneq (,$(PCH)) 174 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 175 | $(GCH): $(PCH) | $(OBJDIR) 176 | @echo $(notdir $<) 177 | $(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 178 | else 179 | $(OBJECTS): | $(OBJDIR) 180 | endif 181 | 182 | $(OBJDIR)/nfd_common.o: ../../src/nfd_common.c 183 | @echo $(notdir $<) 184 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 185 | $(OBJDIR)/nfd_win.o: ../../src/nfd_win.cpp 186 | @echo $(notdir $<) 187 | $(SILENT) $(CXX) $(ALL_CXXFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 188 | 189 | -include $(OBJECTS:%.o=%.d) 190 | ifneq (,$(PCH)) 191 | -include $(OBJDIR)/$(notdir $(PCH)).d 192 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/test_opendialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialog.exe 17 | OBJDIR = ../obj/x64/Release/test_opendialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/nfd.lib -lole32 -luuid 26 | LDDEPS += ../lib/Release/x64/nfd.lib 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialog.exe 44 | OBJDIR = ../obj/x86/Release/test_opendialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/nfd.lib -lole32 -luuid 53 | LDDEPS += ../lib/Release/x86/nfd.lib 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialog_d.exe 71 | OBJDIR = ../obj/x64/Debug/test_opendialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d -lole32 -luuid 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialog_d.exe 98 | OBJDIR = ../obj/x86/Debug/test_opendialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d -lole32 -luuid 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialog.o: ../../test/test_opendialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/test_opendialogmultiple.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_opendialogmultiple.exe 17 | OBJDIR = ../obj/x64/Release/test_opendialogmultiple 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/nfd.lib -lole32 -luuid 26 | LDDEPS += ../lib/Release/x64/nfd.lib 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_opendialogmultiple.exe 44 | OBJDIR = ../obj/x86/Release/test_opendialogmultiple 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/nfd.lib -lole32 -luuid 53 | LDDEPS += ../lib/Release/x86/nfd.lib 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d.exe 71 | OBJDIR = ../obj/x64/Debug/test_opendialogmultiple 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d -lole32 -luuid 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_opendialogmultiple_d.exe 98 | OBJDIR = ../obj/x86/Debug/test_opendialogmultiple 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d -lole32 -luuid 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_opendialogmultiple.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_opendialogmultiple 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_opendialogmultiple 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_opendialogmultiple.o: ../../test/test_opendialogmultiple.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/test_pickfolder.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_pickfolder.exe 17 | OBJDIR = ../obj/x64/Release/test_pickfolder 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/nfd.lib -lole32 -luuid 26 | LDDEPS += ../lib/Release/x64/nfd.lib 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_pickfolder.exe 44 | OBJDIR = ../obj/x86/Release/test_pickfolder 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/nfd.lib -lole32 -luuid 53 | LDDEPS += ../lib/Release/x86/nfd.lib 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_pickfolder_d.exe 71 | OBJDIR = ../obj/x64/Debug/test_pickfolder 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d -lole32 -luuid 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_pickfolder_d.exe 98 | OBJDIR = ../obj/x86/Debug/test_pickfolder 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d -lole32 -luuid 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_pickfolder.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_pickfolder 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_pickfolder 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_pickfolder.o: ../../test/test_pickfolder.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/gmake_windows/test_savedialog.make: -------------------------------------------------------------------------------- 1 | # GNU Make project makefile autogenerated by Premake 2 | 3 | ifndef config 4 | config=release_x64 5 | endif 6 | 7 | ifndef verbose 8 | SILENT = @ 9 | endif 10 | 11 | .PHONY: clean prebuild prelink 12 | 13 | ifeq ($(config),release_x64) 14 | RESCOMP = windres 15 | TARGETDIR = ../bin 16 | TARGET = $(TARGETDIR)/test_savedialog.exe 17 | OBJDIR = ../obj/x64/Release/test_savedialog 18 | DEFINES += -DNDEBUG 19 | INCLUDES += -I../../src/include 20 | FORCE_INCLUDE += 21 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 22 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O2 23 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O2 24 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 25 | LIBS += ../lib/Release/x64/nfd.lib -lole32 -luuid 26 | LDDEPS += ../lib/Release/x64/nfd.lib 27 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x64 -L/usr/lib64 -m64 -s 28 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 29 | define PREBUILDCMDS 30 | endef 31 | define PRELINKCMDS 32 | endef 33 | define POSTBUILDCMDS 34 | endef 35 | all: prebuild prelink $(TARGET) 36 | @: 37 | 38 | endif 39 | 40 | ifeq ($(config),release_x86) 41 | RESCOMP = windres 42 | TARGETDIR = ../bin 43 | TARGET = $(TARGETDIR)/test_savedialog.exe 44 | OBJDIR = ../obj/x86/Release/test_savedialog 45 | DEFINES += -DNDEBUG 46 | INCLUDES += -I../../src/include 47 | FORCE_INCLUDE += 48 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 49 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O2 50 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O2 51 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 52 | LIBS += ../lib/Release/x86/nfd.lib -lole32 -luuid 53 | LDDEPS += ../lib/Release/x86/nfd.lib 54 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Release/x86 -L/usr/lib32 -m32 -s 55 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 56 | define PREBUILDCMDS 57 | endef 58 | define PRELINKCMDS 59 | endef 60 | define POSTBUILDCMDS 61 | endef 62 | all: prebuild prelink $(TARGET) 63 | @: 64 | 65 | endif 66 | 67 | ifeq ($(config),debug_x64) 68 | RESCOMP = windres 69 | TARGETDIR = ../bin 70 | TARGET = $(TARGETDIR)/test_savedialog_d.exe 71 | OBJDIR = ../obj/x64/Debug/test_savedialog 72 | DEFINES += -DDEBUG 73 | INCLUDES += -I../../src/include 74 | FORCE_INCLUDE += 75 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 76 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g 77 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g 78 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 79 | LIBS += -lnfd_d -lole32 -luuid 80 | LDDEPS += 81 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x64 -L/usr/lib64 -m64 82 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 83 | define PREBUILDCMDS 84 | endef 85 | define PRELINKCMDS 86 | endef 87 | define POSTBUILDCMDS 88 | endef 89 | all: prebuild prelink $(TARGET) 90 | @: 91 | 92 | endif 93 | 94 | ifeq ($(config),debug_x86) 95 | RESCOMP = windres 96 | TARGETDIR = ../bin 97 | TARGET = $(TARGETDIR)/test_savedialog_d.exe 98 | OBJDIR = ../obj/x86/Debug/test_savedialog 99 | DEFINES += -DDEBUG 100 | INCLUDES += -I../../src/include 101 | FORCE_INCLUDE += 102 | ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES) 103 | ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -g 104 | ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -g 105 | ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES) 106 | LIBS += -lnfd_d -lole32 -luuid 107 | LDDEPS += 108 | ALL_LDFLAGS += $(LDFLAGS) -L../lib/Debug/x86 -L/usr/lib32 -m32 109 | LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS) 110 | define PREBUILDCMDS 111 | endef 112 | define PRELINKCMDS 113 | endef 114 | define POSTBUILDCMDS 115 | endef 116 | all: prebuild prelink $(TARGET) 117 | @: 118 | 119 | endif 120 | 121 | OBJECTS := \ 122 | $(OBJDIR)/test_savedialog.o \ 123 | 124 | RESOURCES := \ 125 | 126 | CUSTOMFILES := \ 127 | 128 | SHELLTYPE := posix 129 | ifeq (.exe,$(findstring .exe,$(ComSpec))) 130 | SHELLTYPE := msdos 131 | endif 132 | 133 | $(TARGET): $(GCH) ${CUSTOMFILES} $(OBJECTS) $(LDDEPS) $(RESOURCES) | $(TARGETDIR) 134 | @echo Linking test_savedialog 135 | $(SILENT) $(LINKCMD) 136 | $(POSTBUILDCMDS) 137 | 138 | $(CUSTOMFILES): | $(OBJDIR) 139 | 140 | $(TARGETDIR): 141 | @echo Creating $(TARGETDIR) 142 | ifeq (posix,$(SHELLTYPE)) 143 | $(SILENT) mkdir -p $(TARGETDIR) 144 | else 145 | $(SILENT) mkdir $(subst /,\\,$(TARGETDIR)) 146 | endif 147 | 148 | $(OBJDIR): 149 | @echo Creating $(OBJDIR) 150 | ifeq (posix,$(SHELLTYPE)) 151 | $(SILENT) mkdir -p $(OBJDIR) 152 | else 153 | $(SILENT) mkdir $(subst /,\\,$(OBJDIR)) 154 | endif 155 | 156 | clean: 157 | @echo Cleaning test_savedialog 158 | ifeq (posix,$(SHELLTYPE)) 159 | $(SILENT) rm -f $(TARGET) 160 | $(SILENT) rm -rf $(OBJDIR) 161 | else 162 | $(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET)) 163 | $(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR)) 164 | endif 165 | 166 | prebuild: 167 | $(PREBUILDCMDS) 168 | 169 | prelink: 170 | $(PRELINKCMDS) 171 | 172 | ifneq (,$(PCH)) 173 | $(OBJECTS): $(GCH) $(PCH) | $(OBJDIR) 174 | $(GCH): $(PCH) | $(OBJDIR) 175 | @echo $(notdir $<) 176 | $(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<" 177 | else 178 | $(OBJECTS): | $(OBJDIR) 179 | endif 180 | 181 | $(OBJDIR)/test_savedialog.o: ../../test/test_savedialog.c 182 | @echo $(notdir $<) 183 | $(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<" 184 | 185 | -include $(OBJECTS:%.o=%.d) 186 | ifneq (,$(PCH)) 187 | -include $(OBJDIR)/$(notdir $(PCH)).d 188 | endif -------------------------------------------------------------------------------- /nativefiledialog/build/premake5.lua: -------------------------------------------------------------------------------- 1 | -- Native file dialog premake5 script 2 | -- 3 | -- This can be ran directly, but commonly, it is only run 4 | -- by package maintainers. 5 | -- 6 | -- IMPORTANT NOTE: premake5 alpha 9 does not handle this script 7 | -- properly. Build premake5 from Github master, or, presumably, 8 | -- use alpha 10 in the future. 9 | 10 | 11 | newoption { 12 | trigger = "linux_backend", 13 | value = "B", 14 | description = "Choose a dialog backend for linux", 15 | allowed = { 16 | { "gtk3", "GTK 3 - link to gtk3 directly" }, 17 | { "zenity", "Zenity - generate dialogs on the end users machine with zenity" } 18 | } 19 | } 20 | 21 | if not _OPTIONS["linux_backend"] then 22 | _OPTIONS["linux_backend"] = "gtk3" 23 | end 24 | 25 | workspace "NativeFileDialog" 26 | -- these dir specifications assume the generated files have been moved 27 | -- into a subdirectory. ex: $root/build/makefile 28 | local root_dir = path.join(path.getdirectory(_SCRIPT),"../../") 29 | local build_dir = path.join(root_dir,"build/") 30 | configurations { "Release", "Debug" } 31 | 32 | -- Apple stopped distributing an x86 toolchain. Xcode 11 now fails to build with an 33 | -- error if the invalid architecture is present. 34 | -- 35 | -- Add it back in here to build for legacy systems. 36 | filter "system:macosx" 37 | platforms {"x64"} 38 | filter "system:windows or system:linux" 39 | platforms {"x64", "x86"} 40 | 41 | 42 | objdir(path.join(build_dir, "obj/")) 43 | 44 | -- architecture filters 45 | filter "configurations:x86" 46 | architecture "x86" 47 | 48 | filter "configurations:x64" 49 | architecture "x86_64" 50 | 51 | -- debug/release filters 52 | filter "configurations:Debug" 53 | defines {"DEBUG"} 54 | symbols "On" 55 | targetsuffix "_d" 56 | 57 | filter "configurations:Release" 58 | defines {"NDEBUG"} 59 | optimize "On" 60 | 61 | project "nfd" 62 | kind "StaticLib" 63 | 64 | -- common files 65 | files {root_dir.."src/*.h", 66 | root_dir.."src/include/*.h", 67 | root_dir.."src/nfd_common.c", 68 | } 69 | 70 | includedirs {root_dir.."src/include/"} 71 | targetdir(build_dir.."/lib/%{cfg.buildcfg}/%{cfg.platform}") 72 | 73 | warnings "extra" 74 | 75 | -- system build filters 76 | filter "system:windows" 77 | language "C++" 78 | files {root_dir.."src/nfd_win.cpp"} 79 | 80 | filter {"action:gmake or action:xcode4"} 81 | buildoptions {"-fno-exceptions"} 82 | 83 | filter "system:macosx" 84 | language "C" 85 | files {root_dir.."src/nfd_cocoa.m"} 86 | 87 | 88 | 89 | filter {"system:linux", "options:linux_backend=gtk3"} 90 | language "C" 91 | files {root_dir.."src/nfd_gtk.c"} 92 | buildoptions {"`pkg-config --cflags gtk+-3.0`"} 93 | filter {"system:linux", "options:linux_backend=zenity"} 94 | language "C" 95 | files {root_dir.."src/nfd_zenity.c"} 96 | 97 | 98 | -- visual studio filters 99 | filter "action:vs*" 100 | defines { "_CRT_SECURE_NO_WARNINGS" } 101 | 102 | local make_test = function(name) 103 | project(name) 104 | kind "ConsoleApp" 105 | language "C" 106 | dependson {"nfd"} 107 | targetdir(build_dir.."/bin") 108 | files {root_dir.."test/"..name..".c"} 109 | includedirs {root_dir.."src/include/"} 110 | 111 | 112 | filter {"configurations:Debug", "architecture:x86_64"} 113 | links {"nfd_d"} 114 | libdirs {build_dir.."/lib/Debug/x64"} 115 | 116 | filter {"configurations:Debug", "architecture:x86"} 117 | links {"nfd_d"} 118 | libdirs {build_dir.."/lib/Debug/x86"} 119 | 120 | filter {"configurations:Release", "architecture:x86_64"} 121 | links {"nfd"} 122 | libdirs {build_dir.."/lib/Release/x64"} 123 | 124 | filter {"configurations:Release", "architecture:x86"} 125 | links {"nfd"} 126 | libdirs {build_dir.."/lib/Release/x86"} 127 | 128 | filter {"configurations:Debug"} 129 | targetsuffix "_d" 130 | 131 | filter {"configurations:Release", "system:linux", "options:linux_backend=gtk3"} 132 | linkoptions {"-lnfd `pkg-config --libs gtk+-3.0`"} 133 | filter {"configurations:Release", "system:linux", "options:linux_backend=zenity"} 134 | linkoptions {"-lnfd"} 135 | 136 | filter {"system:macosx"} 137 | links {"Foundation.framework", "AppKit.framework"} 138 | 139 | filter {"configurations:Debug", "system:linux", "options:linux_backend=gtk3"} 140 | linkoptions {"-lnfd_d `pkg-config --libs gtk+-3.0`"} 141 | filter {"configurations:Debug", "system:linux", "options:linux_backend=zenity"} 142 | linkoptions {"-lnfd_d"} 143 | 144 | 145 | 146 | filter {"action:gmake", "system:windows"} 147 | links {"ole32", "uuid"} 148 | 149 | end 150 | 151 | make_test("test_pickfolder") 152 | make_test("test_opendialog") 153 | make_test("test_opendialogmultiple") 154 | make_test("test_savedialog") 155 | 156 | newaction 157 | { 158 | trigger = "dist", 159 | description = "Create distributable premake dirs (maintainer only)", 160 | execute = function() 161 | 162 | 163 | local premake_do_action = function(action,os_str,special,args) 164 | local premake_dir 165 | if special then 166 | if args['linux_backend'] ~= nil then 167 | premake_dir = "./"..action.."_"..os_str..'_zenity' 168 | else 169 | premake_dir = "./"..action.."_"..os_str 170 | end 171 | else 172 | premake_dir = "./"..action 173 | end 174 | local premake_path = premake_dir.."/premake5.lua" 175 | 176 | -- create an args str to pass along to premake 177 | arg_str = '' 178 | for arg, val in pairs(args) do 179 | arg_str = ' --'..arg..'='..val 180 | end 181 | 182 | os.execute("mkdir "..premake_dir) 183 | os.execute("cp premake5.lua "..premake_dir) 184 | os.execute("premake5 --os=" ..os_str.. 185 | " --file="..premake_path.. 186 | arg_str.. 187 | " "..action) 188 | os.execute("rm "..premake_path) 189 | end 190 | 191 | premake_do_action("vs2010", "windows", false,{}) 192 | premake_do_action("xcode4", "macosx", false,{}) 193 | premake_do_action("gmake", "linux", true,{}) 194 | premake_do_action("gmake", "linux", true,{linux_backend='zenity'}) 195 | premake_do_action("gmake", "macosx", true,{}) 196 | premake_do_action("gmake", "windows", true,{}) 197 | end 198 | } 199 | 200 | newaction 201 | { 202 | trigger = "clean", 203 | description = "Clean all build files and output", 204 | execute = function () 205 | 206 | files_to_delete = 207 | { 208 | "Makefile", 209 | "*.make", 210 | "*.txt", 211 | "*.7z", 212 | "*.zip", 213 | "*.tar.gz", 214 | "*.db", 215 | "*.opendb", 216 | "*.vcproj", 217 | "*.vcxproj", 218 | "*.vcxproj.user", 219 | "*.vcxproj.filters", 220 | "*.sln", 221 | "*~*" 222 | } 223 | 224 | directories_to_delete = 225 | { 226 | "obj", 227 | "ipch", 228 | "bin", 229 | ".vs", 230 | "Debug", 231 | "Release", 232 | "release", 233 | "lib", 234 | "test", 235 | "makefiles", 236 | "gmake", 237 | "vs2010", 238 | "xcode4", 239 | "gmake_linux", 240 | "gmake_macosx", 241 | "gmake_windows" 242 | } 243 | 244 | for i,v in ipairs( directories_to_delete ) do 245 | os.rmdir( v ) 246 | end 247 | 248 | if os.is "macosx" then 249 | os.execute("rm -rf *.xcodeproj") 250 | os.execute("rm -rf *.xcworkspace") 251 | end 252 | 253 | if not os.is "windows" then 254 | os.execute "find . -name .DS_Store -delete" 255 | for i,v in ipairs( files_to_delete ) do 256 | os.execute( "rm -f " .. v ) 257 | end 258 | else 259 | for i,v in ipairs( files_to_delete ) do 260 | os.execute( "del /F /Q " .. v ) 261 | end 262 | end 263 | 264 | end 265 | } 266 | -------------------------------------------------------------------------------- /nativefiledialog/build/vs2010/NativeFileDialog.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nfd", "nfd.vcxproj", "{5D94880B-C99D-887C-5219-9F7CBE21947C}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_opendialog", "test_opendialog.vcxproj", "{86EEA43A-F279-12FF-FB8A-95F367956EFF}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {5D94880B-C99D-887C-5219-9F7CBE21947C} = {5D94880B-C99D-887C-5219-9F7CBE21947C} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_opendialogmultiple", "test_opendialogmultiple.vcxproj", "{72399713-DE70-DFAA-E77A-43CE533106A4}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {5D94880B-C99D-887C-5219-9F7CBE21947C} = {5D94880B-C99D-887C-5219-9F7CBE21947C} 14 | EndProjectSection 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_pickfolder", "test_pickfolder.vcxproj", "{C7D1F254-335D-6019-3C6E-E30DA878BC19}" 17 | ProjectSection(ProjectDependencies) = postProject 18 | {5D94880B-C99D-887C-5219-9F7CBE21947C} = {5D94880B-C99D-887C-5219-9F7CBE21947C} 19 | EndProjectSection 20 | EndProject 21 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_savedialog", "test_savedialog.vcxproj", "{23941773-8F1F-8537-9830-082C043BE137}" 22 | ProjectSection(ProjectDependencies) = postProject 23 | {5D94880B-C99D-887C-5219-9F7CBE21947C} = {5D94880B-C99D-887C-5219-9F7CBE21947C} 24 | EndProjectSection 25 | EndProject 26 | Global 27 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 28 | Debug|Win32 = Debug|Win32 29 | Debug|x64 = Debug|x64 30 | Release|Win32 = Release|Win32 31 | Release|x64 = Release|x64 32 | EndGlobalSection 33 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 34 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Debug|Win32.ActiveCfg = Debug|Win32 35 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Debug|Win32.Build.0 = Debug|Win32 36 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Debug|x64.ActiveCfg = Debug|x64 37 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Debug|x64.Build.0 = Debug|x64 38 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Release|Win32.ActiveCfg = Release|Win32 39 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Release|Win32.Build.0 = Release|Win32 40 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Release|x64.ActiveCfg = Release|x64 41 | {5D94880B-C99D-887C-5219-9F7CBE21947C}.Release|x64.Build.0 = Release|x64 42 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Debug|Win32.ActiveCfg = Debug|Win32 43 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Debug|Win32.Build.0 = Debug|Win32 44 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Debug|x64.ActiveCfg = Debug|x64 45 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Debug|x64.Build.0 = Debug|x64 46 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Release|Win32.ActiveCfg = Release|Win32 47 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Release|Win32.Build.0 = Release|Win32 48 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Release|x64.ActiveCfg = Release|x64 49 | {86EEA43A-F279-12FF-FB8A-95F367956EFF}.Release|x64.Build.0 = Release|x64 50 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Debug|Win32.ActiveCfg = Debug|Win32 51 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Debug|Win32.Build.0 = Debug|Win32 52 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Debug|x64.ActiveCfg = Debug|x64 53 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Debug|x64.Build.0 = Debug|x64 54 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Release|Win32.ActiveCfg = Release|Win32 55 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Release|Win32.Build.0 = Release|Win32 56 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Release|x64.ActiveCfg = Release|x64 57 | {72399713-DE70-DFAA-E77A-43CE533106A4}.Release|x64.Build.0 = Release|x64 58 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Debug|Win32.ActiveCfg = Debug|Win32 59 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Debug|Win32.Build.0 = Debug|Win32 60 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Debug|x64.ActiveCfg = Debug|x64 61 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Debug|x64.Build.0 = Debug|x64 62 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Release|Win32.ActiveCfg = Release|Win32 63 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Release|Win32.Build.0 = Release|Win32 64 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Release|x64.ActiveCfg = Release|x64 65 | {C7D1F254-335D-6019-3C6E-E30DA878BC19}.Release|x64.Build.0 = Release|x64 66 | {23941773-8F1F-8537-9830-082C043BE137}.Debug|Win32.ActiveCfg = Debug|Win32 67 | {23941773-8F1F-8537-9830-082C043BE137}.Debug|Win32.Build.0 = Debug|Win32 68 | {23941773-8F1F-8537-9830-082C043BE137}.Debug|x64.ActiveCfg = Debug|x64 69 | {23941773-8F1F-8537-9830-082C043BE137}.Debug|x64.Build.0 = Debug|x64 70 | {23941773-8F1F-8537-9830-082C043BE137}.Release|Win32.ActiveCfg = Release|Win32 71 | {23941773-8F1F-8537-9830-082C043BE137}.Release|Win32.Build.0 = Release|Win32 72 | {23941773-8F1F-8537-9830-082C043BE137}.Release|x64.ActiveCfg = Release|x64 73 | {23941773-8F1F-8537-9830-082C043BE137}.Release|x64.Build.0 = Release|x64 74 | EndGlobalSection 75 | GlobalSection(SolutionProperties) = preSolution 76 | HideSolutionNode = FALSE 77 | EndGlobalSection 78 | EndGlobal 79 | -------------------------------------------------------------------------------- /nativefiledialog/build/vs2010/nfd.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | x64 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Debug 18 | Win32 19 | 20 | 21 | 22 | {5D94880B-C99D-887C-5219-9F7CBE21947C} 23 | Win32Proj 24 | nfd 25 | 26 | 27 | 28 | StaticLibrary 29 | false 30 | Unicode 31 | v100 32 | 33 | 34 | StaticLibrary 35 | false 36 | Unicode 37 | v100 38 | 39 | 40 | StaticLibrary 41 | true 42 | Unicode 43 | v100 44 | 45 | 46 | StaticLibrary 47 | true 48 | Unicode 49 | v100 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | ..\lib\Release\x64\ 69 | ..\obj\x64\Release\nfd\ 70 | nfd 71 | .lib 72 | 73 | 74 | ..\lib\Release\x86\ 75 | ..\obj\x86\Release\nfd\ 76 | nfd 77 | .lib 78 | 79 | 80 | ..\lib\Debug\x64\ 81 | ..\obj\x64\Debug\nfd\ 82 | nfd_d 83 | .lib 84 | 85 | 86 | ..\lib\Debug\x86\ 87 | ..\obj\x86\Debug\nfd\ 88 | nfd_d 89 | .lib 90 | 91 | 92 | 93 | NotUsing 94 | Level4 95 | NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 96 | ..\..\src\include;%(AdditionalIncludeDirectories) 97 | Full 98 | true 99 | true 100 | false 101 | true 102 | 103 | 104 | Windows 105 | true 106 | true 107 | 108 | 109 | 110 | 111 | NotUsing 112 | Level4 113 | NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 114 | ..\..\src\include;%(AdditionalIncludeDirectories) 115 | Full 116 | true 117 | true 118 | false 119 | true 120 | 121 | 122 | Windows 123 | true 124 | true 125 | 126 | 127 | 128 | 129 | NotUsing 130 | Level4 131 | DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 132 | ..\..\src\include;%(AdditionalIncludeDirectories) 133 | ProgramDatabase 134 | Disabled 135 | 136 | 137 | Windows 138 | true 139 | 140 | 141 | 142 | 143 | NotUsing 144 | Level4 145 | DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 146 | ..\..\src\include;%(AdditionalIncludeDirectories) 147 | EditAndContinue 148 | Disabled 149 | 150 | 151 | Windows 152 | true 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /nativefiledialog/build/vs2010/nfd.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {89AF369E-F58E-B539-FEA6-40106A051C9B} 6 | 7 | 8 | 9 | 10 | 11 | include 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /nativefiledialog/build/vs2010/test_opendialog.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Release 6 | x64 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Debug 18 | Win32 19 | 20 | 21 | 22 | {86EEA43A-F279-12FF-FB8A-95F367956EFF} 23 | Win32Proj 24 | test_opendialog 25 | 26 | 27 | 28 | Application 29 | false 30 | Unicode 31 | v100 32 | 33 | 34 | Application 35 | false 36 | Unicode 37 | v100 38 | 39 | 40 | Application 41 | true 42 | Unicode 43 | v100 44 | 45 | 46 | Application 47 | true 48 | Unicode 49 | v100 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | false 69 | ..\bin\ 70 | ..\obj\x64\Release\test_opendialog\ 71 | test_opendialog 72 | .exe 73 | 74 | 75 | false 76 | ..\bin\ 77 | ..\obj\x86\Release\test_opendialog\ 78 | test_opendialog 79 | .exe 80 | 81 | 82 | true 83 | ..\bin\ 84 | ..\obj\x64\Debug\test_opendialog\ 85 | test_opendialog_d 86 | .exe 87 | 88 | 89 | true 90 | ..\bin\ 91 | ..\obj\x86\Debug\test_opendialog\ 92 | test_opendialog_d 93 | .exe 94 | 95 | 96 | 97 | NotUsing 98 | Level3 99 | NDEBUG;%(PreprocessorDefinitions) 100 | ..\..\src\include;%(AdditionalIncludeDirectories) 101 | Full 102 | true 103 | true 104 | false 105 | true 106 | 107 | 108 | Console 109 | true 110 | true 111 | ..\lib\Release\x64;%(AdditionalLibraryDirectories) 112 | 113 | 114 | 115 | 116 | NotUsing 117 | Level3 118 | NDEBUG;%(PreprocessorDefinitions) 119 | ..\..\src\include;%(AdditionalIncludeDirectories) 120 | Full 121 | true 122 | true 123 | false 124 | true 125 | 126 | 127 | Console 128 | true 129 | true 130 | ..\lib\Release\x86;%(AdditionalLibraryDirectories) 131 | 132 | 133 | 134 | 135 | NotUsing 136 | Level3 137 | DEBUG;%(PreprocessorDefinitions) 138 | ..\..\src\include;%(AdditionalIncludeDirectories) 139 | ProgramDatabase 140 | Disabled 141 | 142 | 143 | Console 144 | true 145 | nfd_d.lib;%(AdditionalDependencies) 146 | ..\lib\Debug\x64;%(AdditionalLibraryDirectories) 147 | 148 | 149 | false 150 | 151 | 152 | 153 | 154 | NotUsing 155 | Level3 156 | DEBUG;%(PreprocessorDefinitions) 157 | ..\..\src\include;%(AdditionalIncludeDirectories) 158 | EditAndContinue 159 | Disabled 160 | 161 | 162 | Console 163 | true 164 | nfd_d.lib;%(AdditionalDependencies) 165 | ..\lib\Debug\x86;%(AdditionalLibraryDirectories) 166 | 167 | 168 | false 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | {5D94880B-C99D-887C-5219-9F7CBE21947C} 177 | 178 | 179 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /nativefiledialog/build/xcode4/NativeFileDialog.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /nativefiledialog/build/xcode4/nfd.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0815210E38F919004C114F4E /* nfd_cocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 906CCB56B692FB081D99F196 /* nfd_cocoa.m */; }; 11 | F946FD22F308B9942D07BB62 /* nfd_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 5A7B972AA2EC7B5CE78B4D6A /* nfd_common.c */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 42F539D06B2FF28252CB8010 /* simple_exec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = simple_exec.h; path = ../../src/simple_exec.h; sourceTree = ""; }; 16 | 4E280AA77CCE5E99D60FB8E7 /* libnfd.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libnfd.a; path = libnfd.a; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | 5A7B972AA2EC7B5CE78B4D6A /* nfd_common.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = nfd_common.c; path = ../../src/nfd_common.c; sourceTree = ""; }; 18 | 5E955E0662063038E372D446 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = common.h; path = ../../src/common.h; sourceTree = ""; }; 19 | 6832C6170B20ECC99A46CC57 /* nfd.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = nfd.h; path = ../../src/include/nfd.h; sourceTree = ""; }; 20 | 906CCB56B692FB081D99F196 /* nfd_cocoa.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = nfd_cocoa.m; path = ../../src/nfd_cocoa.m; sourceTree = ""; }; 21 | F016F6343887DA667D26AC74 /* nfd_common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = nfd_common.h; path = ../../src/nfd_common.h; sourceTree = ""; }; 22 | /* End PBXFileReference section */ 23 | 24 | /* Begin PBXFrameworksBuildPhase section */ 25 | 5AC8C497AD4EEF897F9352D7 /* Frameworks */ = { 26 | isa = PBXFrameworksBuildPhase; 27 | buildActionMask = 2147483647; 28 | files = ( 29 | ); 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXFrameworksBuildPhase section */ 33 | 34 | /* Begin PBXGroup section */ 35 | 50F305D85C23B5CAB5C63418 /* nfd */ = { 36 | isa = PBXGroup; 37 | children = ( 38 | 5E955E0662063038E372D446 /* common.h */, 39 | 5E8C725002DF100215175890 /* include */, 40 | 906CCB56B692FB081D99F196 /* nfd_cocoa.m */, 41 | 5A7B972AA2EC7B5CE78B4D6A /* nfd_common.c */, 42 | F016F6343887DA667D26AC74 /* nfd_common.h */, 43 | 42F539D06B2FF28252CB8010 /* simple_exec.h */, 44 | A6C936B49B3FADE6EA134CF4 /* Products */, 45 | ); 46 | name = nfd; 47 | sourceTree = ""; 48 | }; 49 | 5E8C725002DF100215175890 /* include */ = { 50 | isa = PBXGroup; 51 | children = ( 52 | 6832C6170B20ECC99A46CC57 /* nfd.h */, 53 | ); 54 | name = include; 55 | sourceTree = ""; 56 | }; 57 | A6C936B49B3FADE6EA134CF4 /* Products */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 4E280AA77CCE5E99D60FB8E7 /* libnfd.a */, 61 | ); 62 | name = Products; 63 | sourceTree = ""; 64 | }; 65 | /* End PBXGroup section */ 66 | 67 | /* Begin PBXNativeTarget section */ 68 | ED35A9AD9188475FA3C08FED /* nfd */ = { 69 | isa = PBXNativeTarget; 70 | buildConfigurationList = 49040CF69B8A37E86DCE9B36 /* Build configuration list for PBXNativeTarget "nfd" */; 71 | buildPhases = ( 72 | CAB045371D367029EF7AD377 /* Resources */, 73 | 345D5E8E86E389805927ECCE /* Sources */, 74 | 5AC8C497AD4EEF897F9352D7 /* Frameworks */, 75 | ); 76 | buildRules = ( 77 | ); 78 | dependencies = ( 79 | ); 80 | name = nfd; 81 | productName = nfd; 82 | productReference = 4E280AA77CCE5E99D60FB8E7 /* libnfd.a */; 83 | productType = "com.apple.product-type.library.static"; 84 | }; 85 | /* End PBXNativeTarget section */ 86 | 87 | /* Begin PBXProject section */ 88 | 08FB7793FE84155DC02AAC07 /* Project object */ = { 89 | isa = PBXProject; 90 | buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "nfd" */; 91 | compatibilityVersion = "Xcode 3.2"; 92 | hasScannedForEncodings = 1; 93 | mainGroup = 50F305D85C23B5CAB5C63418 /* nfd */; 94 | projectDirPath = ""; 95 | projectRoot = ""; 96 | targets = ( 97 | ED35A9AD9188475FA3C08FED /* libnfd.a */, 98 | ); 99 | }; 100 | /* End PBXProject section */ 101 | 102 | /* Begin PBXResourcesBuildPhase section */ 103 | CAB045371D367029EF7AD377 /* Resources */ = { 104 | isa = PBXResourcesBuildPhase; 105 | buildActionMask = 2147483647; 106 | files = ( 107 | ); 108 | runOnlyForDeploymentPostprocessing = 0; 109 | }; 110 | /* End PBXResourcesBuildPhase section */ 111 | 112 | /* Begin PBXSourcesBuildPhase section */ 113 | 345D5E8E86E389805927ECCE /* Sources */ = { 114 | isa = PBXSourcesBuildPhase; 115 | buildActionMask = 2147483647; 116 | files = ( 117 | 0815210E38F919004C114F4E /* nfd_cocoa.m in Sources */, 118 | F946FD22F308B9942D07BB62 /* nfd_common.c in Sources */, 119 | ); 120 | runOnlyForDeploymentPostprocessing = 0; 121 | }; 122 | /* End PBXSourcesBuildPhase section */ 123 | 124 | /* Begin PBXVariantGroup section */ 125 | /* End PBXVariantGroup section */ 126 | 127 | /* Begin XCBuildConfiguration section */ 128 | 6730896713934999D21BBFA7 /* Debug */ = { 129 | isa = XCBuildConfiguration; 130 | buildSettings = { 131 | CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; 132 | CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; 133 | COPY_PHASE_STRIP = NO; 134 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 135 | GCC_OPTIMIZATION_LEVEL = 0; 136 | GCC_PREPROCESSOR_DEFINITIONS = ( 137 | DEBUG, 138 | ); 139 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 140 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 141 | GCC_WARN_UNUSED_VARIABLE = YES; 142 | OBJROOT = obj/x64/Debug/nfd; 143 | ONLY_ACTIVE_ARCH = YES; 144 | OTHER_CFLAGS = ( 145 | "-fno-exceptions", 146 | ); 147 | SYMROOT = ../lib/Debug/x64; 148 | USER_HEADER_SEARCH_PATHS = ( 149 | ../../src/include, 150 | ); 151 | WARNING_CFLAGS = "-Wall -Wextra"; 152 | }; 153 | name = Debug; 154 | }; 155 | 8FABFCB6E6396728BEB27AF6 /* Release */ = { 156 | isa = XCBuildConfiguration; 157 | buildSettings = { 158 | ALWAYS_SEARCH_USER_PATHS = NO; 159 | CONFIGURATION_BUILD_DIR = ../lib/Release/x64; 160 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 161 | GCC_DYNAMIC_NO_PIC = NO; 162 | INSTALL_PATH = /usr/local/lib; 163 | PRODUCT_NAME = nfd; 164 | }; 165 | name = Release; 166 | }; 167 | E9E0596139F3EE13BC721FA1 /* Release */ = { 168 | isa = XCBuildConfiguration; 169 | buildSettings = { 170 | CONFIGURATION_BUILD_DIR = "$(SYMROOT)"; 171 | CONFIGURATION_TEMP_DIR = "$(OBJROOT)"; 172 | GCC_OPTIMIZATION_LEVEL = 3; 173 | GCC_PREPROCESSOR_DEFINITIONS = ( 174 | NDEBUG, 175 | ); 176 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 177 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 178 | GCC_WARN_UNUSED_VARIABLE = YES; 179 | OBJROOT = obj/x64/Release/nfd; 180 | ONLY_ACTIVE_ARCH = NO; 181 | OTHER_CFLAGS = ( 182 | "-fno-exceptions", 183 | ); 184 | SYMROOT = ../lib/Release/x64; 185 | USER_HEADER_SEARCH_PATHS = ( 186 | ../../src/include, 187 | ); 188 | WARNING_CFLAGS = "-Wall -Wextra"; 189 | }; 190 | name = Release; 191 | }; 192 | F08D42BCDB7968AE235F30FC /* Debug */ = { 193 | isa = XCBuildConfiguration; 194 | buildSettings = { 195 | ALWAYS_SEARCH_USER_PATHS = NO; 196 | CONFIGURATION_BUILD_DIR = ../lib/Debug/x64; 197 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 198 | GCC_DYNAMIC_NO_PIC = NO; 199 | INSTALL_PATH = /usr/local/lib; 200 | PRODUCT_NAME = nfd_d; 201 | }; 202 | name = Debug; 203 | }; 204 | /* End XCBuildConfiguration section */ 205 | 206 | /* Begin XCConfigurationList section */ 207 | 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "nfd" */ = { 208 | isa = XCConfigurationList; 209 | buildConfigurations = ( 210 | E9E0596139F3EE13BC721FA1 /* Release */, 211 | 6730896713934999D21BBFA7 /* Debug */, 212 | ); 213 | defaultConfigurationIsVisible = 0; 214 | defaultConfigurationName = Release; 215 | }; 216 | 49040CF69B8A37E86DCE9B36 /* Build configuration list for PBXNativeTarget "libnfd.a" */ = { 217 | isa = XCConfigurationList; 218 | buildConfigurations = ( 219 | 8FABFCB6E6396728BEB27AF6 /* Release */, 220 | F08D42BCDB7968AE235F30FC /* Debug */, 221 | ); 222 | defaultConfigurationIsVisible = 0; 223 | defaultConfigurationName = Release; 224 | }; 225 | /* End XCConfigurationList section */ 226 | }; 227 | rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; 228 | } -------------------------------------------------------------------------------- /nativefiledialog/docs/build.md: -------------------------------------------------------------------------------- 1 | # Building NFD # 2 | 3 | Most of the building instructions are included in [README.md](/README.md). This file just contains apocrypha. 4 | 5 | ## Running Premake5 Directly ## 6 | 7 | *You shouldn't have to run Premake5 directly to build Native File Dialog. This is for package maintainers or people with exotic demands only!* 8 | 9 | 1. [Clone premake-core](https://github.com/premake/premake-core) 10 | 2. [Follow instructions on how to build premake](https://github.com/premake/premake-core/wiki/Building-Premake) 11 | 3. `cd` to `build` 12 | 4. Type `premake5 `, where is the build you want to create. 13 | 14 | ### Package Maintainer Only ### 15 | 16 | I support a custom Premake action: `premake5 dist`, which generates all of the checked in project types in subdirectories. It is useful to run this command if you are submitting a pull request to test all of the supported premake configurations. Do not check in the built projects; I will do so while accepting your pull request. 17 | 18 | ## SCons build (deprecated) ## 19 | 20 | As of 1.1.6, the deprecated and unmaintained SCons support is removed. 21 | 22 | ## Compiling with Mingw ## 23 | 24 | Use the Makefile in `build/gmake_windows` to build Native File Dialog with mingw. Mingw has many distributions and not all of them are reliable. Here is what worked for me, the primary author of Native File Dialog: 25 | 26 | 1. Use mingw64, not mingw32. Downloaded from [sourceforge.net](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download). 27 | 2. When prompted in the intsaller, install the basic compiler and g++. 28 | 3. Add the installed bin dir to command prompt path. 29 | 4. Run `set CC=g++` to enforce `g++` instead of the default, `cc` for compiling and linking. 30 | 5. In `build/gmake_windows`, run `mingw32-make config=release_x64 clean`. Running clean ensures no Visual Studio build products conflict which can cause link errors. 31 | 6. Now run `mingw32-make config=release_x64`. 32 | 33 | The author has not attempted to build or even install an x86 toolchain for mingw. 34 | 35 | If you report an issue, be sure to run make with `verbose=1` so commands are visible. 36 | 37 | ## Adding NFD source directly to your project ## 38 | 39 | Lots of developers add NFD source directly to their projects instead of using the included build scripts. As of 1.1.6, this is an acknowledged approach to building. Of course, everyone has a slightly different toolchain with various warnings and linters enabled. If you run a linter or catch a warning, please consider submitting a pull request to help NFD build cleanly for everyone. 40 | -------------------------------------------------------------------------------- /nativefiledialog/docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Pull Requests # 2 | 3 | I have had to turn away a number of pull requests due to avoidable circumstances. Please read this file before submitting a pull request. Also look at existing, rejected pull requests which state the reason for rejection. 4 | 5 | Here are the rules: 6 | 7 | - **Submit pull requests to the devel branch**. The library must be tested on every compiler and OS, so there is no way I am going to just put your change in the master before it has been sync'd and tested on a number of machines. Master branch is depended upon by hundreds of projects. 8 | 9 | - **Test your changes on all platforms and compilers that you can.** Also, state which platforms you have tested your code on. 32-bit or 64-bit. Clang or GCC. Visual Studio or Mingw. I have to test all these to accept pull requests, so I prioritize changes that respect my time. 10 | 11 | - **Submit Premake build changes only**. As of 1.1, SCons is deprecated. Also, do not submit altered generated projects. I will re-run Premake to re-generate them to ensure that I can still generate the project prior to admitting your pull request. 12 | 13 | - **Do not alter existing behavior to support your desired behavior**. For instance, rewriting file open dialogs to behave differently, while trading off functionality for compatibility, will get you rejected. Consider creating an additional code path. Instead of altering `nfd_win.cpp` to support Windows XP, create `nfd_win_legacy.cpp`, which exists alongside the newer file dialog. 14 | 15 | - **Do not submit anything I can't verify or maintain**. If you add support for a compiler, include from-scratch install instructions that you have tested yourself. Accepting a pull request means I am now the maintainer of your code, so I must understand what it does and how to test it. 16 | 17 | - **Do not change the externally facing API**. NFD needs to maintain ABI compatibility. 18 | 19 | ## Submitting Cloud Autobuild systems ## 20 | 21 | I have received a few pull requests for Travis and AppVeyor-based autobuilding which I have not accepted. NativeFileDialog is officially covered by my private BuildBot network which supports all three target OSes, both CPU architectures and four compilers. I take the view that having a redundant, lesser autobuild system does not improve coverage: it gives a false positive when partial building succeeds. Please do not invest time into cloud-based building with the hope of a pull request being accepted. 22 | 23 | ## Contact Me ## 24 | 25 | Despite all of the "do nots" above, I am happy to recieve new pull requests! If you have any questions about style, or what I would need to accept your specific request, please contact me ahead of submitting the pull request by opening an issue on Github with your question. I will do my best to answer you. 26 | -------------------------------------------------------------------------------- /nativefiledialog/screens/open_cocoa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabioarnold/nfd-zig/ad81729d33da30d5f4fd23718debec48245121ca/nativefiledialog/screens/open_cocoa.png -------------------------------------------------------------------------------- /nativefiledialog/screens/open_gtk3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabioarnold/nfd-zig/ad81729d33da30d5f4fd23718debec48245121ca/nativefiledialog/screens/open_gtk3.png -------------------------------------------------------------------------------- /nativefiledialog/screens/open_win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fabioarnold/nfd-zig/ad81729d33da30d5f4fd23718debec48245121ca/nativefiledialog/screens/open_win.png -------------------------------------------------------------------------------- /nativefiledialog/src/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | Internal, common across platforms 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_COMMON_H 11 | #define _NFD_COMMON_H 12 | 13 | #define NFD_MAX_STRLEN 256 14 | #define _NFD_UNUSED(x) ((void)x) 15 | 16 | void *NFDi_Malloc( size_t bytes ); 17 | void NFDi_Free( void *ptr ); 18 | void NFDi_SetError( const char *msg ); 19 | void NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy ); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /nativefiledialog/src/include/nfd.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | User API 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_H 11 | #define _NFD_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #include 18 | 19 | /* denotes UTF-8 char */ 20 | typedef char nfdchar_t; 21 | 22 | /* opaque data structure -- see NFD_PathSet_* */ 23 | typedef struct { 24 | nfdchar_t *buf; 25 | size_t *indices; /* byte offsets into buf */ 26 | size_t count; /* number of indices into buf */ 27 | }nfdpathset_t; 28 | 29 | typedef enum { 30 | NFD_ERROR, /* programmatic error */ 31 | NFD_OKAY, /* user pressed okay, or successful return */ 32 | NFD_CANCEL /* user pressed cancel */ 33 | }nfdresult_t; 34 | 35 | 36 | /* nfd_.c */ 37 | 38 | /* single file open dialog */ 39 | nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, 40 | const nfdchar_t *defaultPath, 41 | nfdchar_t **outPath ); 42 | 43 | /* multiple file open dialog */ 44 | nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, 45 | const nfdchar_t *defaultPath, 46 | nfdpathset_t *outPaths ); 47 | 48 | /* save dialog */ 49 | nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, 50 | const nfdchar_t *defaultPath, 51 | nfdchar_t **outPath ); 52 | 53 | 54 | /* select folder dialog */ 55 | nfdresult_t NFD_PickFolder( const nfdchar_t *defaultPath, 56 | nfdchar_t **outPath); 57 | 58 | /* nfd_common.c */ 59 | 60 | /* get last error -- set when nfdresult_t returns NFD_ERROR */ 61 | const char *NFD_GetError( void ); 62 | /* get the number of entries stored in pathSet */ 63 | size_t NFD_PathSet_GetCount( const nfdpathset_t *pathSet ); 64 | /* Get the UTF-8 path at offset index */ 65 | nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathSet, size_t index ); 66 | /* Free the pathSet */ 67 | void NFD_PathSet_Free( nfdpathset_t *pathSet ); 68 | 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /nativefiledialog/src/nfd_cocoa.m: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | http://www.frogtoss.com/labs 5 | */ 6 | 7 | #include 8 | #include "nfd.h" 9 | #include "nfd_common.h" 10 | 11 | static NSArray *BuildAllowedFileTypes( const char *filterList ) 12 | { 13 | // Commas and semicolons are the same thing on this platform 14 | 15 | NSMutableArray *buildFilterList = [[NSMutableArray alloc] init]; 16 | 17 | char typebuf[NFD_MAX_STRLEN] = {0}; 18 | 19 | size_t filterListLen = strlen(filterList); 20 | char *p_typebuf = typebuf; 21 | for ( size_t i = 0; i < filterListLen+1; ++i ) 22 | { 23 | if ( filterList[i] == ',' || filterList[i] == ';' || filterList[i] == '\0' ) 24 | { 25 | if (filterList[i] != '\0') 26 | ++p_typebuf; 27 | *p_typebuf = '\0'; 28 | 29 | NSString *thisType = [NSString stringWithUTF8String: typebuf]; 30 | [buildFilterList addObject:thisType]; 31 | p_typebuf = typebuf; 32 | *p_typebuf = '\0'; 33 | } 34 | else 35 | { 36 | *p_typebuf = filterList[i]; 37 | ++p_typebuf; 38 | 39 | } 40 | } 41 | 42 | NSArray *returnArray = [NSArray arrayWithArray:buildFilterList]; 43 | 44 | [buildFilterList release]; 45 | return returnArray; 46 | } 47 | 48 | static void AddFilterListToDialog( NSSavePanel *dialog, const char *filterList ) 49 | { 50 | if ( !filterList || strlen(filterList) == 0 ) 51 | return; 52 | 53 | NSArray *allowedFileTypes = BuildAllowedFileTypes( filterList ); 54 | if ( [allowedFileTypes count] != 0 ) 55 | { 56 | [dialog setAllowedFileTypes:allowedFileTypes]; 57 | } 58 | } 59 | 60 | static void SetDefaultPath( NSSavePanel *dialog, const nfdchar_t *defaultPath ) 61 | { 62 | if ( !defaultPath || strlen(defaultPath) == 0 ) 63 | return; 64 | 65 | NSString *defaultPathString = [NSString stringWithUTF8String: defaultPath]; 66 | NSURL *url = [NSURL fileURLWithPath:defaultPathString isDirectory:YES]; 67 | [dialog setDirectoryURL:url]; 68 | } 69 | 70 | 71 | /* fixme: pathset should be pathSet */ 72 | static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset ) 73 | { 74 | assert(pathset); 75 | assert([urls count]); 76 | 77 | pathset->count = (size_t)[urls count]; 78 | pathset->indices = NFDi_Malloc( sizeof(size_t)*pathset->count ); 79 | if ( !pathset->indices ) 80 | { 81 | return NFD_ERROR; 82 | } 83 | 84 | // count the total space needed for buf 85 | size_t bufsize = 0; 86 | for ( NSURL *url in urls ) 87 | { 88 | NSString *path = [url path]; 89 | bufsize += [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1; 90 | } 91 | 92 | pathset->buf = NFDi_Malloc( sizeof(nfdchar_t) * bufsize ); 93 | if ( !pathset->buf ) 94 | { 95 | return NFD_ERROR; 96 | } 97 | 98 | // fill buf 99 | nfdchar_t *p_buf = pathset->buf; 100 | size_t count = 0; 101 | for ( NSURL *url in urls ) 102 | { 103 | NSString *path = [url path]; 104 | const nfdchar_t *utf8Path = [path UTF8String]; 105 | size_t byteLen = [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1; 106 | memcpy( p_buf, utf8Path, byteLen ); 107 | 108 | ptrdiff_t index = p_buf - pathset->buf; 109 | assert( index >= 0 ); 110 | pathset->indices[count] = (size_t)index; 111 | 112 | p_buf += byteLen; 113 | ++count; 114 | } 115 | 116 | return NFD_OKAY; 117 | } 118 | 119 | /* public */ 120 | 121 | 122 | nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList, 123 | const nfdchar_t *defaultPath, 124 | nfdchar_t **outPath ) 125 | { 126 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 127 | 128 | NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow]; 129 | NSOpenPanel *dialog = [NSOpenPanel openPanel]; 130 | [dialog setAllowsMultipleSelection:NO]; 131 | 132 | // Build the filter list 133 | AddFilterListToDialog(dialog, filterList); 134 | 135 | // Set the starting directory 136 | SetDefaultPath(dialog, defaultPath); 137 | 138 | nfdresult_t nfdResult = NFD_CANCEL; 139 | if ( [dialog runModal] == NSModalResponseOK ) 140 | { 141 | NSURL *url = [dialog URL]; 142 | const char *utf8Path = [[url path] UTF8String]; 143 | 144 | // byte count, not char count 145 | size_t len = strlen(utf8Path);//NFDi_UTF8_Strlen(utf8Path); 146 | 147 | *outPath = NFDi_Malloc( len+1 ); 148 | if ( !*outPath ) 149 | { 150 | [pool release]; 151 | [keyWindow makeKeyAndOrderFront:nil]; 152 | return NFD_ERROR; 153 | } 154 | memcpy( *outPath, utf8Path, len+1 ); /* copy null term */ 155 | nfdResult = NFD_OKAY; 156 | } 157 | [pool release]; 158 | 159 | [keyWindow makeKeyAndOrderFront:nil]; 160 | return nfdResult; 161 | } 162 | 163 | 164 | nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, 165 | const nfdchar_t *defaultPath, 166 | nfdpathset_t *outPaths ) 167 | { 168 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 169 | NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow]; 170 | 171 | NSOpenPanel *dialog = [NSOpenPanel openPanel]; 172 | [dialog setAllowsMultipleSelection:YES]; 173 | 174 | // Build the fiter list. 175 | AddFilterListToDialog(dialog, filterList); 176 | 177 | // Set the starting directory 178 | SetDefaultPath(dialog, defaultPath); 179 | 180 | nfdresult_t nfdResult = NFD_CANCEL; 181 | if ( [dialog runModal] == NSModalResponseOK ) 182 | { 183 | NSArray *urls = [dialog URLs]; 184 | 185 | if ( [urls count] == 0 ) 186 | { 187 | [pool release]; 188 | [keyWindow makeKeyAndOrderFront:nil]; 189 | return NFD_CANCEL; 190 | } 191 | 192 | if ( AllocPathSet( urls, outPaths ) == NFD_ERROR ) 193 | { 194 | [pool release]; 195 | [keyWindow makeKeyAndOrderFront:nil]; 196 | return NFD_ERROR; 197 | } 198 | 199 | nfdResult = NFD_OKAY; 200 | } 201 | [pool release]; 202 | 203 | [keyWindow makeKeyAndOrderFront:nil]; 204 | return nfdResult; 205 | } 206 | 207 | 208 | nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, 209 | const nfdchar_t *defaultPath, 210 | nfdchar_t **outPath ) 211 | { 212 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 213 | NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow]; 214 | 215 | NSSavePanel *dialog = [NSSavePanel savePanel]; 216 | [dialog setExtensionHidden:NO]; 217 | 218 | // Build the filter list. 219 | AddFilterListToDialog(dialog, filterList); 220 | 221 | // Set the starting directory 222 | SetDefaultPath(dialog, defaultPath); 223 | 224 | nfdresult_t nfdResult = NFD_CANCEL; 225 | if ( [dialog runModal] == NSModalResponseOK ) 226 | { 227 | NSURL *url = [dialog URL]; 228 | const char *utf8Path = [[url path] UTF8String]; 229 | 230 | size_t byteLen = [url.path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1; 231 | 232 | *outPath = NFDi_Malloc( byteLen ); 233 | if ( !*outPath ) 234 | { 235 | [pool release]; 236 | [keyWindow makeKeyAndOrderFront:nil]; 237 | return NFD_ERROR; 238 | } 239 | memcpy( *outPath, utf8Path, byteLen ); 240 | nfdResult = NFD_OKAY; 241 | } 242 | 243 | [pool release]; 244 | [keyWindow makeKeyAndOrderFront:nil]; 245 | return nfdResult; 246 | } 247 | 248 | nfdresult_t NFD_PickFolder(const nfdchar_t *defaultPath, 249 | nfdchar_t **outPath) 250 | { 251 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 252 | 253 | NSWindow *keyWindow = [[NSApplication sharedApplication] keyWindow]; 254 | NSOpenPanel *dialog = [NSOpenPanel openPanel]; 255 | [dialog setAllowsMultipleSelection:NO]; 256 | [dialog setCanChooseDirectories:YES]; 257 | [dialog setCanCreateDirectories:YES]; 258 | [dialog setCanChooseFiles:NO]; 259 | 260 | // Set the starting directory 261 | SetDefaultPath(dialog, defaultPath); 262 | 263 | nfdresult_t nfdResult = NFD_CANCEL; 264 | if ( [dialog runModal] == NSModalResponseOK ) 265 | { 266 | NSURL *url = [dialog URL]; 267 | const char *utf8Path = [[url path] UTF8String]; 268 | 269 | // byte count, not char count 270 | size_t len = strlen(utf8Path);//NFDi_UTF8_Strlen(utf8Path); 271 | 272 | *outPath = NFDi_Malloc( len+1 ); 273 | if ( !*outPath ) 274 | { 275 | [pool release]; 276 | [keyWindow makeKeyAndOrderFront:nil]; 277 | return NFD_ERROR; 278 | } 279 | memcpy( *outPath, utf8Path, len+1 ); /* copy null term */ 280 | nfdResult = NFD_OKAY; 281 | } 282 | [pool release]; 283 | 284 | [keyWindow makeKeyAndOrderFront:nil]; 285 | return nfdResult; 286 | } 287 | -------------------------------------------------------------------------------- /nativefiledialog/src/nfd_common.c: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | http://www.frogtoss.com/labs 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include "nfd_common.h" 11 | 12 | static char g_errorstr[NFD_MAX_STRLEN] = {0}; 13 | 14 | /* public routines */ 15 | 16 | const char *NFD_GetError( void ) 17 | { 18 | return g_errorstr; 19 | } 20 | 21 | size_t NFD_PathSet_GetCount( const nfdpathset_t *pathset ) 22 | { 23 | assert(pathset); 24 | return pathset->count; 25 | } 26 | 27 | nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathset, size_t num ) 28 | { 29 | assert(pathset); 30 | assert(num < pathset->count); 31 | 32 | return pathset->buf + pathset->indices[num]; 33 | } 34 | 35 | void NFD_PathSet_Free( nfdpathset_t *pathset ) 36 | { 37 | assert(pathset); 38 | NFDi_Free( pathset->indices ); 39 | NFDi_Free( pathset->buf ); 40 | } 41 | 42 | /* internal routines */ 43 | 44 | void *NFDi_Malloc( size_t bytes ) 45 | { 46 | void *ptr = malloc(bytes); 47 | if ( !ptr ) 48 | NFDi_SetError("NFDi_Malloc failed."); 49 | 50 | return ptr; 51 | } 52 | 53 | void NFDi_Free( void *ptr ) 54 | { 55 | assert(ptr); 56 | free(ptr); 57 | } 58 | 59 | void NFDi_SetError( const char *msg ) 60 | { 61 | int bTruncate = NFDi_SafeStrncpy( g_errorstr, msg, NFD_MAX_STRLEN ); 62 | assert( !bTruncate ); _NFD_UNUSED(bTruncate); 63 | } 64 | 65 | 66 | int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy ) 67 | { 68 | size_t n = maxCopy; 69 | char *d = dst; 70 | 71 | assert( src ); 72 | assert( dst ); 73 | 74 | while ( n > 0 && *src != '\0' ) 75 | { 76 | *d++ = *src++; 77 | --n; 78 | } 79 | 80 | /* Truncation case - 81 | terminate string and return true */ 82 | if ( n == 0 ) 83 | { 84 | dst[maxCopy-1] = '\0'; 85 | return 1; 86 | } 87 | 88 | /* No truncation. Append a single NULL and return. */ 89 | *d = '\0'; 90 | return 0; 91 | } 92 | 93 | 94 | /* adapted from microutf8 */ 95 | int32_t NFDi_UTF8_Strlen( const nfdchar_t *str ) 96 | { 97 | /* This function doesn't properly check validity of UTF-8 character 98 | sequence, it is supposed to use only with valid UTF-8 strings. */ 99 | 100 | int32_t character_count = 0; 101 | int32_t i = 0; /* Counter used to iterate over string. */ 102 | nfdchar_t maybe_bom[4]; 103 | 104 | /* If there is UTF-8 BOM ignore it. */ 105 | if (strlen(str) > 2) 106 | { 107 | strncpy(maybe_bom, str, 3); 108 | maybe_bom[3] = 0; 109 | if (strcmp(maybe_bom, (nfdchar_t*)NFD_UTF8_BOM) == 0) 110 | i += 3; 111 | } 112 | 113 | while(str[i]) 114 | { 115 | if (str[i] >> 7 == 0) 116 | { 117 | /* If bit pattern begins with 0 we have ascii character. */ 118 | ++character_count; 119 | } 120 | else if (str[i] >> 6 == 3) 121 | { 122 | /* If bit pattern begins with 11 it is beginning of UTF-8 byte sequence. */ 123 | ++character_count; 124 | } 125 | else if (str[i] >> 6 == 2) 126 | ; /* If bit pattern begins with 10 it is middle of utf-8 byte sequence. */ 127 | else 128 | { 129 | /* In any other case this is not valid UTF-8. */ 130 | return -1; 131 | } 132 | ++i; 133 | } 134 | 135 | return character_count; 136 | } 137 | 138 | int NFDi_IsFilterSegmentChar( char ch ) 139 | { 140 | return (ch==','||ch==';'||ch=='\0'); 141 | } 142 | 143 | -------------------------------------------------------------------------------- /nativefiledialog/src/nfd_common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | Internal, common across platforms 5 | 6 | http://www.frogtoss.com/labs 7 | */ 8 | 9 | 10 | #ifndef _NFD_COMMON_H 11 | #define _NFD_COMMON_H 12 | 13 | #include "nfd.h" 14 | 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define NFD_MAX_STRLEN 256 22 | #define _NFD_UNUSED(x) ((void)x) 23 | 24 | #define NFD_UTF8_BOM "\xEF\xBB\xBF" 25 | 26 | 27 | void *NFDi_Malloc( size_t bytes ); 28 | void NFDi_Free( void *ptr ); 29 | void NFDi_SetError( const char *msg ); 30 | int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy ); 31 | int32_t NFDi_UTF8_Strlen( const nfdchar_t *str ); 32 | int NFDi_IsFilterSegmentChar( char ch ); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /nativefiledialog/src/nfd_zenity.c: -------------------------------------------------------------------------------- 1 | /* 2 | Native File Dialog 3 | 4 | http://www.frogtoss.com/labs 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include "nfd.h" 11 | #include "nfd_common.h" 12 | 13 | #define SIMPLE_EXEC_IMPLEMENTATION 14 | #include "simple_exec.h" 15 | 16 | 17 | const char NO_ZENITY_MSG[] = "zenity not installed"; 18 | 19 | 20 | static void AddTypeToFilterName( const char *typebuf, char *filterName, size_t bufsize ) 21 | { 22 | size_t len = strlen(filterName); 23 | if( len > 0 ) 24 | strncat( filterName, " *.", bufsize - len - 1 ); 25 | else 26 | strncat( filterName, "--file-filter=*.", bufsize - len - 1 ); 27 | 28 | len = strlen(filterName); 29 | strncat( filterName, typebuf, bufsize - len - 1 ); 30 | } 31 | 32 | static void AddFiltersToCommandArgs(char** commandArgs, int commandArgsLen, const char *filterList ) 33 | { 34 | char typebuf[NFD_MAX_STRLEN] = {0}; 35 | const char *p_filterList = filterList; 36 | char *p_typebuf = typebuf; 37 | char filterName[NFD_MAX_STRLEN] = {0}; 38 | int i; 39 | 40 | if ( !filterList || strlen(filterList) == 0 ) 41 | return; 42 | 43 | while ( 1 ) 44 | { 45 | 46 | if ( NFDi_IsFilterSegmentChar(*p_filterList) ) 47 | { 48 | char typebufWildcard[NFD_MAX_STRLEN]; 49 | /* add another type to the filter */ 50 | assert( strlen(typebuf) > 0 ); 51 | assert( strlen(typebuf) < NFD_MAX_STRLEN-1 ); 52 | 53 | snprintf( typebufWildcard, NFD_MAX_STRLEN, "*.%s", typebuf ); 54 | 55 | AddTypeToFilterName( typebuf, filterName, NFD_MAX_STRLEN ); 56 | 57 | p_typebuf = typebuf; 58 | memset( typebuf, 0, sizeof(char) * NFD_MAX_STRLEN ); 59 | } 60 | 61 | if ( *p_filterList == ';' || *p_filterList == '\0' ) 62 | { 63 | /* end of filter -- add it to the dialog */ 64 | 65 | for(i = 0; commandArgs[i] != NULL && i < commandArgsLen; i++); 66 | 67 | commandArgs[i] = strdup(filterName); 68 | 69 | filterName[0] = '\0'; 70 | 71 | if ( *p_filterList == '\0' ) 72 | break; 73 | } 74 | 75 | if ( !NFDi_IsFilterSegmentChar( *p_filterList ) ) 76 | { 77 | *p_typebuf = *p_filterList; 78 | p_typebuf++; 79 | } 80 | 81 | p_filterList++; 82 | } 83 | 84 | /* always append a wildcard option to the end*/ 85 | 86 | for(i = 0; commandArgs[i] != NULL && i < commandArgsLen; i++); 87 | 88 | commandArgs[i] = strdup("--file-filter=*.*"); 89 | } 90 | 91 | static nfdresult_t ZenityCommon(char** command, int commandLen, const char* defaultPath, const char* filterList, char** stdOut) 92 | { 93 | if(defaultPath != NULL) 94 | { 95 | char* prefix = "--filename="; 96 | int len = strlen(prefix) + strlen(defaultPath) + 1; 97 | 98 | char* tmp = (char*) calloc(len, 1); 99 | strcat(tmp, prefix); 100 | strcat(tmp, defaultPath); 101 | 102 | int i; 103 | for(i = 0; command[i] != NULL && i < commandLen; i++); 104 | 105 | command[i] = tmp; 106 | } 107 | 108 | AddFiltersToCommandArgs(command, commandLen, filterList); 109 | 110 | int byteCount = 0; 111 | int exitCode = 0; 112 | int processInvokeError = runCommandArray(stdOut, &byteCount, &exitCode, 0, command); 113 | 114 | for(int i = 0; command[i] != NULL && i < commandLen; i++) 115 | free(command[i]); 116 | 117 | nfdresult_t result = NFD_OKAY; 118 | 119 | if(processInvokeError == COMMAND_NOT_FOUND) 120 | { 121 | NFDi_SetError(NO_ZENITY_MSG); 122 | result = NFD_ERROR; 123 | } 124 | else 125 | { 126 | if(exitCode == 1) 127 | result = NFD_CANCEL; 128 | } 129 | 130 | return result; 131 | } 132 | 133 | 134 | static nfdresult_t AllocPathSet(char* zenityList, nfdpathset_t *pathSet ) 135 | { 136 | assert(zenityList); 137 | assert(pathSet); 138 | 139 | size_t len = strlen(zenityList) + 1; 140 | pathSet->buf = NFDi_Malloc(len); 141 | 142 | int numEntries = 1; 143 | 144 | for(size_t i = 0; i < len; i++) 145 | { 146 | char ch = zenityList[i]; 147 | 148 | if(ch == '|') 149 | { 150 | numEntries++; 151 | ch = '\0'; 152 | } 153 | 154 | pathSet->buf[i] = ch; 155 | } 156 | 157 | pathSet->count = numEntries; 158 | assert( pathSet->count > 0 ); 159 | 160 | pathSet->indices = NFDi_Malloc( sizeof(size_t)*pathSet->count ); 161 | 162 | int entry = 0; 163 | pathSet->indices[0] = 0; 164 | for(size_t i = 0; i < len; i++) 165 | { 166 | char ch = zenityList[i]; 167 | 168 | if(ch == '|') 169 | { 170 | entry++; 171 | pathSet->indices[entry] = i + 1; 172 | } 173 | } 174 | 175 | return NFD_OKAY; 176 | } 177 | 178 | /* public */ 179 | 180 | nfdresult_t NFD_OpenDialog( const char *filterList, 181 | const nfdchar_t *defaultPath, 182 | nfdchar_t **outPath ) 183 | { 184 | int commandLen = 100; 185 | char* command[commandLen]; 186 | memset(command, 0, commandLen * sizeof(char*)); 187 | 188 | command[0] = strdup("zenity"); 189 | command[1] = strdup("--file-selection"); 190 | command[2] = strdup("--title=Open File"); 191 | 192 | char* stdOut = NULL; 193 | nfdresult_t result = ZenityCommon(command, commandLen, defaultPath, filterList, &stdOut); 194 | 195 | if(stdOut != NULL) 196 | { 197 | size_t len = strlen(stdOut); 198 | *outPath = NFDi_Malloc(len); 199 | memcpy(*outPath, stdOut, len); 200 | (*outPath)[len-1] = '\0'; // trim out the final \n with a null terminator 201 | free(stdOut); 202 | } 203 | else 204 | { 205 | *outPath = NULL; 206 | } 207 | 208 | return result; 209 | } 210 | 211 | 212 | nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList, 213 | const nfdchar_t *defaultPath, 214 | nfdpathset_t *outPaths ) 215 | { 216 | int commandLen = 100; 217 | char* command[commandLen]; 218 | memset(command, 0, commandLen * sizeof(char*)); 219 | 220 | command[0] = strdup("zenity"); 221 | command[1] = strdup("--file-selection"); 222 | command[2] = strdup("--title=Open Files"); 223 | command[3] = strdup("--multiple"); 224 | 225 | char* stdOut = NULL; 226 | nfdresult_t result = ZenityCommon(command, commandLen, defaultPath, filterList, &stdOut); 227 | 228 | if(stdOut != NULL) 229 | { 230 | size_t len = strlen(stdOut); 231 | stdOut[len-1] = '\0'; // remove trailing newline 232 | 233 | if ( AllocPathSet( stdOut, outPaths ) == NFD_ERROR ) 234 | result = NFD_ERROR; 235 | 236 | free(stdOut); 237 | } 238 | else 239 | { 240 | result = NFD_ERROR; 241 | } 242 | 243 | return result; 244 | } 245 | 246 | nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList, 247 | const nfdchar_t *defaultPath, 248 | nfdchar_t **outPath ) 249 | { 250 | int commandLen = 100; 251 | char* command[commandLen]; 252 | memset(command, 0, commandLen * sizeof(char*)); 253 | 254 | command[0] = strdup("zenity"); 255 | command[1] = strdup("--file-selection"); 256 | command[2] = strdup("--title=Save File"); 257 | command[3] = strdup("--save"); 258 | 259 | char* stdOut = NULL; 260 | nfdresult_t result = ZenityCommon(command, commandLen, defaultPath, filterList, &stdOut); 261 | 262 | if(stdOut != NULL) 263 | { 264 | size_t len = strlen(stdOut); 265 | *outPath = NFDi_Malloc(len); 266 | memcpy(*outPath, stdOut, len); 267 | (*outPath)[len-1] = '\0'; // trim out the final \n with a null terminator 268 | free(stdOut); 269 | } 270 | else 271 | { 272 | *outPath = NULL; 273 | } 274 | 275 | return result; 276 | } 277 | 278 | nfdresult_t NFD_PickFolder(const nfdchar_t *defaultPath, 279 | nfdchar_t **outPath) 280 | { 281 | int commandLen = 100; 282 | char* command[commandLen]; 283 | memset(command, 0, commandLen * sizeof(char*)); 284 | 285 | command[0] = strdup("zenity"); 286 | command[1] = strdup("--file-selection"); 287 | command[2] = strdup("--directory"); 288 | command[3] = strdup("--title=Select folder"); 289 | 290 | char* stdOut = NULL; 291 | nfdresult_t result = ZenityCommon(command, commandLen, defaultPath, "", &stdOut); 292 | 293 | if(stdOut != NULL) 294 | { 295 | size_t len = strlen(stdOut); 296 | *outPath = NFDi_Malloc(len); 297 | memcpy(*outPath, stdOut, len); 298 | (*outPath)[len-1] = '\0'; // trim out the final \n with a null terminator 299 | free(stdOut); 300 | } 301 | else 302 | { 303 | *outPath = NULL; 304 | } 305 | 306 | return result; 307 | } 308 | -------------------------------------------------------------------------------- /nativefiledialog/src/simple_exec.h: -------------------------------------------------------------------------------- 1 | // copied from: https://github.com/wheybags/simple_exec/blob/5a74c507c4ce1b2bb166177ead4cca7cfa23cb35/simple_exec.h 2 | 3 | // simple_exec.h, single header library to run external programs + retrieve their status code and output (unix only for now) 4 | // 5 | // do this: 6 | // #define SIMPLE_EXEC_IMPLEMENTATION 7 | // before you include this file in *one* C or C++ file to create the implementation. 8 | // i.e. it should look like this: 9 | // #define SIMPLE_EXEC_IMPLEMENTATION 10 | // #include "simple_exec.h" 11 | 12 | #ifndef SIMPLE_EXEC_H 13 | #define SIMPLE_EXEC_H 14 | 15 | int runCommand(char** stdOut, int* stdOutByteCount, int* returnCode, int includeStdErr, char* command, ...); 16 | int runCommandArray(char** stdOut, int* stdOutByteCount, int* returnCode, int includeStdErr, char* const* allArgs); 17 | 18 | #endif // SIMPLE_EXEC_H 19 | 20 | #ifdef SIMPLE_EXEC_IMPLEMENTATION 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #define release_assert(exp) { if (!(exp)) { abort(); } } 32 | 33 | enum PIPE_FILE_DESCRIPTORS 34 | { 35 | READ_FD = 0, 36 | WRITE_FD = 1 37 | }; 38 | 39 | enum RUN_COMMAND_ERROR 40 | { 41 | COMMAND_RAN_OK = 0, 42 | COMMAND_NOT_FOUND = 1 43 | }; 44 | 45 | int runCommandArray(char** stdOut, int* stdOutByteCount, int* returnCode, int includeStdErr, char* const* allArgs) 46 | { 47 | // adapted from: https://stackoverflow.com/a/479103 48 | 49 | int bufferSize = 256; 50 | char buffer[bufferSize + 1]; 51 | 52 | int dataReadFromChildDefaultSize = bufferSize * 5; 53 | int dataReadFromChildSize = dataReadFromChildDefaultSize; 54 | int dataReadFromChildUsed = 0; 55 | char* dataReadFromChild = (char*)malloc(dataReadFromChildSize); 56 | 57 | 58 | int parentToChild[2]; 59 | release_assert(pipe(parentToChild) == 0); 60 | 61 | int childToParent[2]; 62 | release_assert(pipe(childToParent) == 0); 63 | 64 | int errPipe[2]; 65 | release_assert(pipe(errPipe) == 0); 66 | 67 | pid_t pid; 68 | switch( pid = fork() ) 69 | { 70 | case -1: 71 | { 72 | release_assert(0 && "Fork failed"); 73 | break; 74 | } 75 | 76 | case 0: // child 77 | { 78 | release_assert(dup2(parentToChild[READ_FD ], STDIN_FILENO ) != -1); 79 | release_assert(dup2(childToParent[WRITE_FD], STDOUT_FILENO) != -1); 80 | 81 | if(includeStdErr) 82 | { 83 | release_assert(dup2(childToParent[WRITE_FD], STDERR_FILENO) != -1); 84 | } 85 | else 86 | { 87 | int devNull = open("/dev/null", O_WRONLY); 88 | release_assert(dup2(devNull, STDERR_FILENO) != -1); 89 | } 90 | 91 | // unused 92 | release_assert(close(parentToChild[WRITE_FD]) == 0); 93 | release_assert(close(childToParent[READ_FD ]) == 0); 94 | release_assert(close(errPipe[READ_FD]) == 0); 95 | 96 | const char* command = allArgs[0]; 97 | execvp(command, allArgs); 98 | 99 | char err = 1; 100 | ssize_t result = write(errPipe[WRITE_FD], &err, 1); 101 | release_assert(result != -1); 102 | 103 | close(errPipe[WRITE_FD]); 104 | close(parentToChild[READ_FD]); 105 | close(childToParent[WRITE_FD]); 106 | 107 | exit(0); 108 | } 109 | 110 | 111 | default: // parent 112 | { 113 | // unused 114 | release_assert(close(parentToChild[READ_FD]) == 0); 115 | release_assert(close(childToParent[WRITE_FD]) == 0); 116 | release_assert(close(errPipe[WRITE_FD]) == 0); 117 | 118 | while(1) 119 | { 120 | ssize_t bytesRead = 0; 121 | switch(bytesRead = read(childToParent[READ_FD], buffer, bufferSize)) 122 | { 123 | case 0: // End-of-File, or non-blocking read. 124 | { 125 | int status = 0; 126 | release_assert(waitpid(pid, &status, 0) == pid); 127 | 128 | // done with these now 129 | release_assert(close(parentToChild[WRITE_FD]) == 0); 130 | release_assert(close(childToParent[READ_FD]) == 0); 131 | 132 | char errChar = 0; 133 | ssize_t result = read(errPipe[READ_FD], &errChar, 1); 134 | release_assert(result != -1); 135 | close(errPipe[READ_FD]); 136 | 137 | if(errChar) 138 | { 139 | free(dataReadFromChild); 140 | return COMMAND_NOT_FOUND; 141 | } 142 | 143 | // free any un-needed memory with realloc + add a null terminator for convenience 144 | dataReadFromChild = (char*)realloc(dataReadFromChild, dataReadFromChildUsed + 1); 145 | dataReadFromChild[dataReadFromChildUsed] = '\0'; 146 | 147 | if(stdOut != NULL) 148 | *stdOut = dataReadFromChild; 149 | else 150 | free(dataReadFromChild); 151 | 152 | if(stdOutByteCount != NULL) 153 | *stdOutByteCount = dataReadFromChildUsed; 154 | if(returnCode != NULL) 155 | *returnCode = WEXITSTATUS(status); 156 | 157 | return COMMAND_RAN_OK; 158 | } 159 | case -1: 160 | { 161 | release_assert(0 && "read() failed"); 162 | break; 163 | } 164 | 165 | default: 166 | { 167 | if(dataReadFromChildUsed + bytesRead + 1 >= dataReadFromChildSize) 168 | { 169 | dataReadFromChildSize += dataReadFromChildDefaultSize; 170 | dataReadFromChild = (char*)realloc(dataReadFromChild, dataReadFromChildSize); 171 | } 172 | 173 | memcpy(dataReadFromChild + dataReadFromChildUsed, buffer, bytesRead); 174 | dataReadFromChildUsed += bytesRead; 175 | break; 176 | } 177 | } 178 | } 179 | } 180 | } 181 | } 182 | 183 | int runCommand(char** stdOut, int* stdOutByteCount, int* returnCode, int includeStdErr, char* command, ...) 184 | { 185 | va_list vl; 186 | va_start(vl, command); 187 | 188 | char* currArg = NULL; 189 | 190 | int allArgsInitialSize = 16; 191 | int allArgsSize = allArgsInitialSize; 192 | char** allArgs = (char**)malloc(sizeof(char*) * allArgsSize); 193 | allArgs[0] = command; 194 | 195 | int i = 1; 196 | do 197 | { 198 | currArg = va_arg(vl, char*); 199 | allArgs[i] = currArg; 200 | 201 | i++; 202 | 203 | if(i >= allArgsSize) 204 | { 205 | allArgsSize += allArgsInitialSize; 206 | allArgs = (char**)realloc(allArgs, sizeof(char*) * allArgsSize); 207 | } 208 | 209 | } while(currArg != NULL); 210 | 211 | va_end(vl); 212 | 213 | int retval = runCommandArray(stdOut, stdOutByteCount, returnCode, includeStdErr, allArgs); 214 | free(allArgs); 215 | return retval; 216 | } 217 | 218 | #endif //SIMPLE_EXEC_IMPLEMENTATION 219 | -------------------------------------------------------------------------------- /nativefiledialog/test/test_opendialog.c: -------------------------------------------------------------------------------- 1 | #include "nfd.h" 2 | 3 | #include 4 | #include 5 | 6 | 7 | /* this test should compile on all supported platforms */ 8 | 9 | int main( void ) 10 | { 11 | nfdchar_t *outPath = NULL; 12 | nfdresult_t result = NFD_OpenDialog( "png,jpg;pdf", NULL, &outPath ); 13 | if ( result == NFD_OKAY ) 14 | { 15 | puts("Success!"); 16 | puts(outPath); 17 | free(outPath); 18 | } 19 | else if ( result == NFD_CANCEL ) 20 | { 21 | puts("User pressed cancel."); 22 | } 23 | else 24 | { 25 | printf("Error: %s\n", NFD_GetError() ); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /nativefiledialog/test/test_opendialogmultiple.c: -------------------------------------------------------------------------------- 1 | #include "nfd.h" 2 | 3 | #include 4 | #include 5 | 6 | /* this test should compile on all supported platforms */ 7 | 8 | int main( void ) 9 | { 10 | nfdpathset_t pathSet; 11 | nfdresult_t result = NFD_OpenDialogMultiple( "png,jpg;pdf", NULL, &pathSet ); 12 | if ( result == NFD_OKAY ) 13 | { 14 | size_t i; 15 | for ( i = 0; i < NFD_PathSet_GetCount(&pathSet); ++i ) 16 | { 17 | nfdchar_t *path = NFD_PathSet_GetPath(&pathSet, i); 18 | printf("Path %i: %s\n", (int)i, path ); 19 | } 20 | NFD_PathSet_Free(&pathSet); 21 | } 22 | else if ( result == NFD_CANCEL ) 23 | { 24 | puts("User pressed cancel."); 25 | } 26 | else 27 | { 28 | printf("Error: %s\n", NFD_GetError() ); 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /nativefiledialog/test/test_pickfolder.c: -------------------------------------------------------------------------------- 1 | #include "nfd.h" 2 | 3 | #include 4 | #include 5 | 6 | 7 | /* this test should compile on all supported platforms */ 8 | 9 | int main( void ) 10 | { 11 | nfdchar_t *outPath = NULL; 12 | nfdresult_t result = NFD_PickFolder( NULL, &outPath ); 13 | if ( result == NFD_OKAY ) 14 | { 15 | puts("Success!"); 16 | puts(outPath); 17 | free(outPath); 18 | } 19 | else if ( result == NFD_CANCEL ) 20 | { 21 | puts("User pressed cancel."); 22 | } 23 | else 24 | { 25 | printf("Error: %s\n", NFD_GetError() ); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /nativefiledialog/test/test_savedialog.c: -------------------------------------------------------------------------------- 1 | #include "nfd.h" 2 | 3 | #include 4 | #include 5 | 6 | /* this test should compile on all supported platforms */ 7 | 8 | int main( void ) 9 | { 10 | nfdchar_t *savePath = NULL; 11 | nfdresult_t result = NFD_SaveDialog( "png,jpg;pdf", NULL, &savePath ); 12 | if ( result == NFD_OKAY ) 13 | { 14 | puts("Success!"); 15 | puts(savePath); 16 | free(savePath); 17 | } 18 | else if ( result == NFD_CANCEL ) 19 | { 20 | puts("User pressed cancel."); 21 | } 22 | else 23 | { 24 | printf("Error: %s\n", NFD_GetError() ); 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /src/c.zig: -------------------------------------------------------------------------------- 1 | pub usingnamespace @cImport({ 2 | @cInclude("nfd.h"); 3 | }); 4 | -------------------------------------------------------------------------------- /src/demo.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const nfd = @import("nfd"); 3 | 4 | pub fn main() !void { 5 | const file_path = try nfd.saveFileDialog("txt", null); 6 | if (file_path) |path| { 7 | defer nfd.freePath(path); 8 | std.debug.print("saveFileDialog result: {s}\n", .{path}); 9 | 10 | const open_path = try nfd.openFileDialog("txt", path); 11 | if (open_path) |path2| { 12 | defer nfd.freePath(path2); 13 | std.debug.print("openFileDialog result: {s}\n", .{path2}); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/lib.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const c = @import("c.zig"); 3 | const log = std.log.scoped(.nfd); 4 | 5 | pub const Error = error{ 6 | NfdError, 7 | }; 8 | 9 | pub fn makeError() Error { 10 | if (c.NFD_GetError()) |ptr| { 11 | log.debug("{s}\n", .{ 12 | std.mem.sliceTo(ptr, 0), 13 | }); 14 | } 15 | return error.NfdError; 16 | } 17 | 18 | /// Open single file dialog 19 | pub fn openFileDialog(filter: ?[:0]const u8, default_path: ?[:0]const u8) Error!?[:0]const u8 { 20 | var out_path: [*c]u8 = null; 21 | 22 | // allocates using malloc 23 | const result = c.NFD_OpenDialog(if (filter != null) filter.? else null, if (default_path != null) default_path.? else null, &out_path); 24 | 25 | return switch (result) { 26 | c.NFD_OKAY => if (out_path == null) null else std.mem.sliceTo(out_path, 0), 27 | c.NFD_ERROR => makeError(), 28 | else => null, 29 | }; 30 | } 31 | 32 | /// Open save dialog 33 | pub fn saveFileDialog(filter: ?[:0]const u8, default_path: ?[:0]const u8) Error!?[:0]const u8 { 34 | var out_path: [*c]u8 = null; 35 | 36 | // allocates using malloc 37 | const result = c.NFD_SaveDialog( 38 | if (filter != null) filter.?.ptr else null, 39 | if (default_path != null) default_path.?.ptr else null, 40 | &out_path); 41 | 42 | return switch (result) { 43 | c.NFD_OKAY => if (out_path == null) null else std.mem.sliceTo(out_path, 0), 44 | c.NFD_ERROR => makeError(), 45 | else => null, 46 | }; 47 | } 48 | 49 | /// Open folder dialog 50 | pub fn openFolderDialog(default_path: ?[:0]const u8) Error!?[:0]const u8 { 51 | var out_path: [*c]u8 = null; 52 | 53 | // allocates using malloc 54 | const result = c.NFD_PickFolder( 55 | if (default_path != null) default_path.?.ptr else null, 56 | &out_path); 57 | 58 | return switch (result) { 59 | c.NFD_OKAY => if (out_path == null) null else std.mem.sliceTo(out_path, 0), 60 | c.NFD_ERROR => makeError(), 61 | else => null, 62 | }; 63 | } 64 | 65 | pub fn freePath(path: []const u8) void { 66 | std.c.free(@constCast(path.ptr)); 67 | } 68 | --------------------------------------------------------------------------------