LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-31-2012, 09:22 PM   #1
vtucf
LQ Newbie
 
Registered: Mar 2012
Posts: 1

Rep: Reputation: Disabled
Removing source files from a public directory after compilation


Hi,

I would like to know how I can modify makefile.am / makefile.in . makefile (I am not sure which file is relevant!) to remove *.f source files everytime I compile my fortran codes. The idea is to

(a) Move the required source files in to the src directory of the project.

(b) compile to create executable using 'make', and,

(c) clean up the source files after creation of the executable.

(d) If need to recompile, run 'make clean' & repeat the procedure above.

The project directory I am working in is public but I have been directed to not share the source code for my project. Can someone please help?

Thanks so much.

Regards,
vtucf
 
Old 03-31-2012, 09:43 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,362

Rep: Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004Reputation: 2004
Usually it's as simple as adding a "rm -f *.f" after the compile command. Depends on how the makefile is set up though.

For one of my projects, I have the make command automatically clear out all of the .o files after compilation, so it builds from scratch every time. For that, I have this in my makefile:
Code:
target.exe: $(OBJS)
      $(FC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
      rm *.o *.mod
Just make damn sure you don't accidentally run a "make" where you actually keep the source

Last edited by suicidaleggroll; 03-31-2012 at 09:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Public Source for Public Education LXer Syndicated Linux News 0 10-19-2010 07:50 AM
Removing obsolete backup files and containing directory franjo124 Linux - Newbie 2 03-30-2009 08:05 AM
OpenCV compilation problem (add directory for including header files) maikki Programming 2 01-07-2009 09:07 AM
Kernel module with multiple source files compilation problem Last Attacker Programming 7 05-06-2006 10:10 AM
GTKMM - Compilation Errors - Can't find files or Directory sixtensixone Programming 3 04-06-2005 11:06 AM


All times are GMT -5. The time now is 06:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration