LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-13-2004, 02:45 PM   #1
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Rep: Reputation: 15
make install not working>


I am having trouble writing a Makefile that can determine what command to run based on who the user is.

Code:
bash-2.05b$ cat Makefile
NOTES_INSTALL_DIR = /tmp
install:
        runner=`whoami` ; \
        if test $$runner != "root" ; \
        then \
                echo "You are not root. Have password ready"; \
                su -c "cp index.html bookmarks.html notes.css ${NOTES_INSTALL_DIR}"; \
        else \
                echo "You are root" ; \
                cp index.html bookmarks.html notes.css ${NOTES_INSTALL_DIR}"; \
        fi
bash-2.05b$ make install
runner=`whoami` ; \
if test $runner != "root" ; \
then \
        echo "You are not root. Have password ready"; \
        su -c "cp index.html bookmarks.html notes.css /tmp"; \
else \
        echo "You are root" ; \
        cp index.html bookmarks.html notes.css /tmp"; \
fi
/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 2: syntax error: unexpected end of file
make: *** [install] Error 2
bash-2.05b$

Should that work ?
 
Old 08-13-2004, 03:19 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Same question answered here: http://www.linuxquestions.org/questi...hreadid=217247

Edit: clarified what the link was for

Last edited by Dark_Helmet; 08-13-2004 at 06:14 PM.
 
Old 08-13-2004, 03:45 PM   #3
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
You've got mismatched brackets in the line:

Code:
cp index.html bookmarks.html notes.css ${NOTES_INSTALL_DIR}"; \
 
Old 08-13-2004, 03:47 PM   #4
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
Oh, and you shouldn't cross-post. The moderators don't like it. This thread really belongs in the programming forum.
 
Old 08-14-2004, 12:35 PM   #5
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Moved to the Programming forum
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
package compiling from source, make & make install concepts shujja Linux - Newbie 2 09-20-2005 12:18 AM
Chap 5 Binutils make LDFLAGS & make install errors shotokan Linux From Scratch 5 04-10-2005 03:01 AM
make; make install commands in SuSE Linux 9.1 Personal johnerskine Linux - Newbie 6 06-23-2004 10:18 AM
How to make rule for make install and make uninstall melinda_sayang Programming 1 06-14-2004 05:58 AM
'make' & 'make install commands not recognised by shell gilbertt Linux - Software 4 05-04-2004 08:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration