Sponsored Content
Top Forums Shell Programming and Scripting Need help from a C++ makefile guru Post 302965058 by f77hack on Saturday 23rd of January 2016 02:31:03 AM
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+++
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
cxref-cpp(1)						      General Commands Manual						      cxref-cpp(1)

NAME
cxref-cpp - A modified C preprocessor to use with cxref. SYNOPSIS
cxref-cpp ... DESCRIPTION
To improve the output that is available for the source code for cross-referencing a modified version of the GNU CPP v2.7.2 is supplied (named cxref-cpp). This modified C preprocessor allows for a finer control over some features of the preprocessing that are not important for a compiler. In a standard preprocessor, the preprocessor directives are intended for use only by the preprocessor, so passing the information through is not important. With cxref-cpp, there are some features that are different to the standard GNU CPP: Compared to gcc versions earlier than version 2.8.0 there is an extra option that will output the #include lines from the source file. In version 2.8.0 and later this option is present. Comments trailing a #include or a #define are not preserved by all versions of gcc even if the -C option is used. This is not important while compiling, but is useful for documenting. The cxref-cpp program will take on the personality of the installed version of gcc so that the gcc header files can be parsed. This means that it includes the same default include directory paths and macro definitions. The file that contains these definitions is called cxref-cpp.defines and is installed by the cxref-cpp-configure program or specified by the -cxref-cpp-defines command line option. OPTIONS
The same as for gcc, apart from '-cxref-cpp-defines' described above. SEE ALSO
cxref(1), cxref-cpp-configure(1), gcc(1) May 9, 2004 cxref-cpp(1)
All times are GMT -4. The time now is 02:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy