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?
Thanks
iamthesgt
0
Junior Poster
Recommended Answers
Jump to PostHello iamthesgt!
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 …
Jump to PostComputers are dumb; you need to 'verb' the script what to do. You are executing those values; instead, you need to echo them so that the outer assignment can catch the printed value.
All 5 Replies
JeoSaurus
32
Posting Whiz in Training
iamthesgt
0
Junior Poster
iamthesgt
0
Junior Poster
Fest3er
39
Posting Whiz in Training
iamthesgt
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.