LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Some questions on an autogenerated Makefile (https://www.linuxquestions.org/questions/programming-9/some-questions-on-an-autogenerated-makefile-637443/)

binarybob0001 04-24-2008 12:37 AM

Some questions on an autogenerated Makefile
 
Can someone explain what these lines mean?
This is the toplevel makefile. I don't understand what's going one with the $(top_srcdir)/configure.in and such.
Code:

SUBDIRS = $(TOPSUBDIRS)

$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
        cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;

$(top_srcdir)/subdirs:
        cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs

$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
        @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4

MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files

package-messages:
        cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
        $(MAKE) -C po merge

EXTRA_DIST = admin COPYING configure.in.in

dist-hook:
        cd $(top_distdir) && perl admin/am_edit -padmin
        cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs

And then there is the Makefile for the actual program itself in ./src.
Code:

# set the include path for X, qt and KDE
INCLUDES = $(all_includes)

# these are the headers for your project

# let automoc handle all of the meta source files (moc)
METASOURCES = AUTO

messages: rc.cpp
        $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
        $(XGETTEXT) *.cpp -o $(podir)/sigcreate.pot

KDE_ICON = AUTO

#########################################################################
# APPLICATION SECTION
#########################################################################
# this is the program that gets installed.  it's name is used for all
# of the other Makefile.am variables
bin_PROGRAMS = sigcreate

# the application source, library search path, and link libraries
sigcreate_SOURCES = main.cpp sigcreate.cpp sigcreatedlg.ui
sigcreate_LDFLAGS = $(KDE_RPATH) $(all_libraries)
sigcreate_LDADD = $(LIB_KDEUI)

# this is where the desktop file will go
shelldesktopdir  = $(kde_appsdir)/Utilities
shelldesktop_DATA = sigcreate.desktop

# this is where the shell's XML-GUI resource file goes
shellrcdir  = $(kde_datadir)/sigcreate
shellrc_DATA = sigcreateui.rc

noinst_HEADERS = sigcreate.h

What is this thing with rc.cpp? Thanks for helping me understand this.

binarybob0001 04-24-2008 03:04 AM

Ok, I now understand everything in the second file except for the
Code:

messages: rc.cpp
        $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
        $(XGETTEXT) *.cpp -o $(podir)/sigcreate.pot

What does that do? It looks like it is trying to build a file called rc.cpp what does this file do? I cannot find any information on the variables EXTRACTRC, XGETTEXT and podir. Can someone explain this line to me? The Makefile.am in the top level source directory is a complete mystery. What does this line do:
Code:

$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
        cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;

and this line
Code:

package-messages:
        cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
        $(MAKE) -C po merge

Knowing this stuff could greatly enhance my ability to generate my own custom Makefiles. Thanks again.

binarybob0001 04-27-2008 12:02 AM

Anyone know how to write this stuff yet. I'm still trying...


All times are GMT -5. The time now is 02:16 PM.