LinuxQuestions.org
Review your favorite Linux distribution.
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 10-30-2011, 02:59 PM   #1
ejspeiro
Member
 
Registered: Feb 2011
Distribution: Ubuntu 14.04 LTS (Trusty Tahr)
Posts: 203

Rep: Reputation: 26
Question Question about Makefile structure: is it compiling by itself?


Hello guys,

I may have to read about Makefiles quite some more, but I would like at least at hint at what to read about the following behavior at my Makefile:

I have this as my Makefile:

PHP Code:
# Makefile for the SRC folder.

include ../makefile_set.inc

all
double

DOUBLE  
= \
    
c_mtk_double_crs_sparse_matrix_array_print.\
    
c_mtk_double_crs_sparse_matrix_block_print.\
    
c_mtk_double_crs_sparse_matrix_create_from_1d_array.\
    
c_mtk_tool_manager_abort.\
    
c_mtk_double_crs_sparse_matrix_free.\
    
c_mtk_double_ccs_sparse_matrix_create_from_1d_array.\
    
c_mtk_double_ccs_sparse_matrix_array_print.\
    
c_mtk_double_ccs_sparse_matrix_free.\
    
c_mtk_double_ccs_sparse_matrix_block_print.o

double
: $(DOUBLE)
    @echo -
'----- Compiling the types in double precision: Done!\n' 
BUT, when I execute make I get the following:

Code:
ejspeiro@citadel:~/Dropbox/Public/mtk/trunk/cmtk-v1.0/src$ make
cc    -c -o c_mtk_double_crs_sparse_matrix_array_print.o c_mtk_double_crs_sparse_matrix_array_print.c
But HOW? How does my makefile knows that it should execute that particular method for compiling... my problem is that I'm trying to define my own, but I will keep doing that one!

Thanks in advanced!
 
Old 10-30-2011, 03:42 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ejspeiro View Post
...
But HOW? How does my makefile knows that it should execute that particular method for compiling... my problem is that I'm trying to define my own, but I will keep doing that one!

Thanks in advanced!
There are default rules. Try http://www.student.cs.uwaterloo.ca/~isg/res/unix/make/ , http://www.gnu.org/software/make/manual/make.html , etc.
 
1 members found this post helpful.
Old 10-30-2011, 08:41 PM   #3
ejspeiro
Member
 
Registered: Feb 2011
Distribution: Ubuntu 14.04 LTS (Trusty Tahr)
Posts: 203

Original Poster
Rep: Reputation: 26
Thanks Sergei! The tutorials worked awesome!

Regards!
 
  


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
problem while compiling driver Makefile biswajit.2k3 Linux - Newbie 1 07-06-2009 06:34 AM
Help compiling a ungrab-windmodem.ko Makefile NirvanaII Mandriva 2 10-20-2008 08:57 PM
Makefile and compiling the linux kernel ayoub Linux - Newbie 0 12-02-2005 04:25 AM
RedHat3.0: problem when compiling C++ code using the 'ldap' structure WuKitty Linux - Software 0 09-12-2005 01:52 PM
Compiling old code: Makefile plus config.in cbcallaw Linux - Software 1 04-29-2004 05:35 PM

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

All times are GMT -5. The time now is 10:19 AM.

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