Need help from a C++ makefile guru


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help from a C++ makefile guru
# 1  
Old 01-23-2016
Need help from a C++ makefile guru

hello,

i'm recompiling some c++ code for OSX and there are some bugs as the configure is not picking up some libs like atlas, pastix, etc, it should be finding either in standard path or with pkgconfig but it's not so i'm rewriting the Makefile. C++ territory is a bit of a stretch with all of the preprocessing that needs to be done then linked.

i usually use rules to keep makefiles simple but i don't know if I'll break something with my bash inside the makefile?

there are 2 binaries and a static lib as a result, each has different flags with some common source elements so the object files are renamed so they are aren't overwritten.

someone else has a better way to do this?

anyway there are a LOT of lines in the file like this which i'd like to safely reduce to rules

------------as is --------
Code:
$(STATICLIB)_la_OBJECTS = libtest_la-c_evl ...+30 more.

Code:
$(STATICLIB)_SOURCES = c_evl.cpp .....+30 more

Code:
test-c_geo.o: c_geo.cpp
	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CXXFLAGS) $(CXXFLAGS) -c -o test-c_geo.o c_geo.cpp

Code:
libtest_la-c_evl.lo: c_evl.cpp
	$(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(LOTS_OF_FLAGS) $(libtest_la_CXXFLAGS) $(CXXFLAGS) -c -o libtest_la-c_evlcom.lo c_evl.cpp

---------- will this work ? --------

maybe it is just easier to dump the object files for each into a separate director and then use implicit rules?

---------- Post updated 01-23-16 at 02:31 AM ---------- Previous update was 01-22-16 at 06:29 PM ----------

FYI, it was just easier to dump the object files into separate directories and compile.

whoever thought libtool/autoconf is a good thing? i turned about 6000 lines of bloated code into about 200. compiles libraries in 1/3 the time.

Last edited by f77hack; 01-22-2016 at 07:40 PM.. Reason: typos+++
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

Noob and Guru

A long time ago, my computer crashed, at that time, I was using Windows98, but because I was a noob at computers, my friend recommended me apro to fix it for me.   He came, saw the computer, and asked if I had a backup/installation disk for Windows 98. I said no.   He thought about it for a... (1 Reply)
Discussion started by: vistastar
1 Replies

2. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

3. Shell Programming and Scripting

New PERL guru's help on strict.pm

I opened strict.pm and found some not understandable stuff, please let me know if you have any Idea on the same. 1) Line 23 => $bits |= (what is $= here how it affect the statement) 2) Line 36 => $^H (what is that I haven't found any statement on this in google) 3) Line 41 =>... (3 Replies)
Discussion started by: jatanig
3 Replies

4. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

5. Shell Programming and Scripting

UNIX Guru's help on diff

Hi , I wanted to find delata between two huge ( 8 GB ) files . Say file_TDY and file_YDY : These files are sorted based on a key . I am using a command : 1)bdiff file_TDY file_YDY > diff_file 2) grep ' ^< ' diff_file > TDY_delta I wanted only the changed records and newly added... (2 Replies)
Discussion started by: ajaybalki
2 Replies

6. AIX

-- Need help from a AIX guru --

Hi alls I don't see any solution and I need to have feedback from other people... On a test machine (AIX 5.1) I've installed OpenSSH software on it (with openssl, prng, etc...) like is described on IBM AIX Docs. To control the installation I've rebooted the machine and all was ok (CDE was... (15 Replies)
Discussion started by: nymus7
15 Replies

7. UNIX for Dummies Questions & Answers

To all the Java guru...

Please forgive me if this is the wrong place for this post. I didn't see a good place to post this topic in. :D I would like to know what's the most popular and reliable Java IDE out there nowadays? A FREE one would be awesome! :D Thanks for your suggestion! Cheers! (10 Replies)
Discussion started by: laila63
10 Replies

8. UNIX for Advanced & Expert Users

what do most Unix guru's use ? :D

I wanted to know what email app most Sun solaris / unix gurus use ? I have become quite NON microsoft in the last few months in my studying solaris.. thanks simon2000 (6 Replies)
Discussion started by: simon2000
6 Replies

9. UNIX for Advanced & Expert Users

sun guru help!

I installed sun recommended cluster patches for solaris 2.5 on my solaris 2.5 server and then issued a shutdown -i6 -y -g0 to reboot the server but server failed to come back up. the server tries to boot up and goes through initialising memory then server freeze. I try to bring the server up... (7 Replies)
Discussion started by: hassan2
7 Replies

10. UNIX for Advanced & Expert Users

Perl Guru help

I am trying to install Perl 5.005 on solaris 2.5, following the perl installation guide in INSTALL file that comes with Perl software However, according to the installation procedure, it instruct me to to excute "make" command after running the Configure which I did but everytime I excute... (3 Replies)
Discussion started by: hassan2
3 Replies
Login or Register to Ask a Question