PDA

View Full Version : [SOLVED] Trying to run a makefile



Chris_Laskaris
October 15th, 2015, 06:15 PM
I have some source code and a makefile (named make_node00) for Linux, and I am trying to use the makefile to compile the program from source. Which command do I have to use to do this? I am posting the beginning of the makefile here:


#------------------------------------------------------
# Makefile for compiling on linux
#------------------------------------------------------

SHELL = /bin/sh

.SUFFIXES: .F .c .o

# [and so on, commands for compiling the program follow after this]

I have tried sh make_node00 and ./make_node00, but I am getting error messages (SHELL: not found, or SHELL: command not found, and the same for all the other commands in the makefile).

I feel I should be able to get the makefile to work if I only find the right command for it, and it's probably very easy. But I am new to using such makefiles.

Thank you for your help!

steeldriver
October 15th, 2015, 06:32 PM
make -f make_node00


Although it would be more usual to use a default name such as Makefile or makefile so that you only need to type



make

Chris_Laskaris
October 15th, 2015, 06:49 PM
Thank you! That did it.

dwhitney67
October 22nd, 2015, 09:31 PM
Thank you! That did it.

Btw, your Makefile does not require the executable bit enabled on it. Typically a Makefile only has read-write permissions. Earlier when you indicated that when you ran your Makefile such as ./make_node00, you should have seen an error indicating "permission denied".