I was writing a makefile for a web interface program that installs the cgi scripts to a (Linux) OS. The makefile works fine, but it needs to be able to install to different directories for different distributions (Fedora, Ubuntu). On Fedora, the scripts need to go to /var/www/cgi-bin and on Ubuntu, I believe it is /usr/lib/www/cgi-bin.
When I run uname -n on Ubuntu, it outputs "ubuntu", but on Fedora, it gives a combination of the username, computer name, and "hostname".
Does anyone have any idea how to determine the distribution in a makefile?
Jump to Post
I'm sure there's some standard way to do this, but I don't know it. There are lots of pre-existing scripts out there that are similar to this one, but here's something I have been using for a while:
#!/bin/bash # Check for FreeBSD in …
All 5 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.