![]() ![]() OS detecting makefile. If you do not need sophisticated stuff as done by Git LSF, you can detect the Operating System just using two simple tricks: environment variable OSand then the command uname - sifeq ($(OS),Windows_NT). OS : = Windows. detected_OS : = $(shell uname - s). Or a more safe way, if not Windows and command uname not available: ifeq ($(OS),Windows_NT). OS : = Windows. detected_OS : = $(shell sh - c 'uname - s 2> /dev/null || echo not'). Then you can select the relevant stuff depending on detected_OS: ifeq ($(detected_OS),Windows). CFLAGS += - D WIN3. OS),Darwin) # Mac OS X. CFLAGS += - D OSX. OS),Linux). CFLAGS += - D LINUX. OS),GNU) # Debian GNU Hurd. CFLAGS += - D GNU_HURD. OS),GNU/k. Free. BSD) # Debian k. This page presents an approach to turning a minimal installation of Fedora 26 into a standalone Kodi 17.x (Krypton) installation, with minimal additional software. Download and install. To use the UFRaw Gimp plug-in you need first to install Gimp 2.0 or higher. Gimp 2.4 is recommended. If you only plan to use UFRaw's stand-alone. Update: I wrote this in 2009! That was forty Internet years ago. I'm leaving this article here in an archival state. But please, use Homebrew to install PuTTY. Free. BSD. CFLAGS += - D GNU_k. Free. BSD. ifeq ($(detected_OS),Free. BSD). CFLAGS += - D Free. BSD. ifeq ($(detected_OS),Net. BSD). CFLAGS += - D Net. BSD. ifeq ($(detected_OS),Dragon. Fly). CFLAGS += - D Dragon. Fly. ifeq ($(detected_OS),Haiku). CFLAGS += - D Haiku. Please see also this detailed answer about importance of uname - s better than uname - o. The use of OS (instead of uname - s) simplifies the identification algorithm. You can still use solely uname - s but you have to deal with if/else blocks to check all Min. GW/Cygwin/.. variations. Note: The environment variable OS is always set to "Windows_NT" on any Windows platform (see Windows Environment Variables on Wikipedia). An alternative of OS is the environment variable MSVC (it checks the presence of MS Visual Studio, see example using MSVC). Below I provide a complete example using make and gcc to build a shared library: *. The example is as simplest as possible to be more understandable : -)To install make and gcc on Windows see Cygwin or Min. GW. My example is based on 5 files ├── lib. Makefile. │ └── hello. Makefile. └── main. Do not forget: files Makefile are indented using tabulations. The two files Makefile. Makefileifeq ($(OS),Windows_NT). S : = Windows. uname_S : = $(shell uname - s). S), Windows). target = hello. S), Linux). target = libhello. S), ...) #See https: //stackoverflow. PIC - o $@. # - c $< => $< is first file after ': ' => Compile hello. PIC => Position- Independent Code (required for shared lib). Output file (- o) is hello. Generate shared library. Output file (- o) is $@ (libhello. Makefileifeq ($(OS),Windows_NT). S : = Windows. uname_S : = $(shell uname - s). S), Windows). target = app. S), Linux). target = app. S), ...) #See https: //stackoverflow. I ./lib - o $@. # - c $< => compile (- c) $< (first file after : ) = main. I ./lib => search headers (*. L./lib - lhello - o $@. L./lib => look for libraries in directory ./lib. To learn more, read Automatic Variables documentation as pointed out by cfi. The source code- lib/hello. HELLO_H_. #define HELLO_H_. The build. Fix the copy- paste of Makefile (replace leading spaces by one tabulation).> sed 's/^ */\t/' - i */Makefile. The make command is the same on both platforms. The given output is on Unix- like OSes: > make - C lib. Entering directory '/tmp/lib'. PIC - o hello. o. Compile hello. c. PIC => Position- Independent Code (required for shared lib). Output file (- o) is hello. Link hello. o. # - shared => Generate shared library. Output file (- o) is libhello. Leaving directory '/tmp/lib'. C app. make: Entering directory '/tmp/app'. I ./lib - o main. I ./lib => search headers (*. L./lib - lhello - o app. L./lib => look for libraries in directory ./lib. Leaving directory '/tmp/app'. The run. The application requires to know where is the shared library. On Windows, a simple solution is to copy the library where the application is: > cp - v lib/hello. On Unix- like OSes, you can use the LD_LIBRARY_PATH environment variable: > export LD_LIBRARY_PATH=lib. Run the command on Windows: > app/app. Run the command on Unix- like OSes: > app/app. Mac OS X Hints - A community- built collection of OS X hints. This is my take/an update on las_vegas' hint I found here awhile back for running OS updates without creating a user on a Mac. It is applicable to any system 1. This can be helpful if you have a Time Machine backup that's on a newer OS than your install media, or if you're selling/donating your Mac as it saves the new user having to update things. First things first, wipe your drive (and zero it if you don't trust the end user of this computer) and reinstall your desired OS. Once your OS is installed, boot to your install media or the Recovery Partition if available. Open Terminal from the Utilities option in the menubar. In the new Terminal window, type the following. This will bring up the Password Reset utility. Click Macintosh HD or whatever your HDD is called. You'll notice the only user account that's available is root. Enter a password you'd like to use/remember, though it doesn't really matter as we'll be disabling root and removing this password later. Click save, close the password reset utility and go back to working in Terminal. Now you'll want to enter the following command. Volumes/Macintosh\ HD/private/var/db/. Apple. Setup. Done. This will create the file on Macintosh HD that tells the computer it has completed the setup so you're able to skip the process and login with the root account we just enabled. Close Terminal and reboot the computer into the Macintosh HD. You should be greeted by the login screen with an option that says Other. Click Other, enter root as the username and the password you chose to login. Proceed with Software Updates and any optional software you'd like to install, making sure to install for All Users if prompted. Also keep in mind that any preference changes you make will only apply to the root user, so there's no sense in wasting any time customizing the look, feel and general operation of the computer. After all software is installed, open up Terminal once more. Enter the following code. Apple. Setup. Done. This will remove the file we originally created and re- enable the setup assistant to help create the new/first user on the Mac. Next, open up Directory Utility. This can be found in Users & Groups in System Preferences. Click Login Options, then click Join.. Network Account Server. You should then see the option Open Directory Utility. Once in Directory Utility, click Edit in the menubar and then select Disable root user. As a note, this can be done while logged in as root. Close Directory Utility and restart the computer, booting back into to your install media or Recovery Partition. Open up Terminal one last time and enter. Once the Password Reset utility has appeared, click the root user once more. Instead of changing the password, however, simply click the Reset button to reset Home Folder ACLs. Reboot your Mac, confirm you see the Setup Assistant and you're ready to move onto restoring your backup or selling your computer! I haven't tested this one.].
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |