freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] How to collect the side-by-side lists of source & object file


From: mpsuzuki
Subject: [ft-devel] How to collect the side-by-side lists of source & object files from FreeType2 building system?
Date: Fri, 28 Nov 2008 15:14:46 +0900

Hi all,

As Turner had pointed out 1 month ago, today it is expensive
to keep the platform-specific files updated. I already ASCII-
fied MacOS MPW makefile, to be easily-modified by any text
editors. At present, when new module sources are introduced,
it's possible for any FreeType2 maintainers to register new
module in MPW makefiles. However, I'm sure it is troublesome
work for most maintainers to work for platform-specific building
system.

Thus, in next, I want to automate the maintenance of MPW makefiles.
If I have a list of the pairs of the source and object file
for "single build", it's easy to make MPW makefile updated
automatically, by common Unix environment.

# I guess builds/atari/FREETYPE.PRJ has similar issue, its
# modules are not updated since its introduction in 5 years ago.
# Nothing to say, the volunteers' efforts are required to
# guarantee the correct building & the functionalities, but
# I wish if the update of "project files" can be done without
# spending volunteers' sparetime.

What I want is...

* $(BASE_SRC_S) and $(BASE_OBJ_S),
* $(BASE_EXT_SRC) (their objects $(BASE_EXT_OBJ) is not essential),
* $(modulename_DRV_SRC) and its object $(modulename_DRV_SRC).

Also I want to strip $(SRC_DIR) and $(OBJ_DIR) directories.
Is there any smart method to obtain them?

Regards,
mpsuzuki



P.S.
I didn't have good idea to let "make" dump such values during
real building process, and I'm not sure if these naming
convention of make-variables in FreeType2 project are stable.
So I'm trying to obtain the list during building process.

Easy idea would be using popular "-M" options of C compilers
to obtain the dependency list by the compilation command.
Unfortunately, it collects all dependent files. What I want
is the source file and the object file specified by the command
line. The information I want is to write a simple rule like,

        xxx.o: xxx.c
                $(CC) $(CFLAGS) -o xxx.o xxx.c

not the full dependency, because I cannot write such rule.

        xxx.o: a.h b.h c.h d.h ... xxx.c y.h z.h
                $(CC) $(CFLAGS) -o xxx.o a.h b.h ...

So I tried to write a shell script which finds the source
file(s) as an intersection of the full dependency list
and the pathnames given to the compilers. it is "make-odep.sh"
attached to this message. It can be used as GNU libtool,
aslike

        sh make-odep.sh
                --convert-string /home/mpsuzuki/freetype2/objs='${OBJ_DIR}' \
                --convert-string /home/mpsuzuki/freetype2='${TOP_DIR}' \
                gcc -I/home/mpsuzuki/freetype2/objs \
                -I./builds/unix \
                -I/home/mpsuzuki/freetype2/include \
                -DFT2_BUILD_LIBRARY \
                -DFT_CONFIG_MODULES_H="<ftmodule.h>" \
                -I/home/mpsuzuki/freetype2/src/psnames \
                -o /home/mpsuzuki/freetype2/objs/psnames.odep \
                /home/mpsuzuki/freetype2/src/psnames/psmodule.c

# this is a good example that the object file name "psnames.o" is
# different from the name expected from source file "psmodule.c".

Its output psnames.odep is shell script like this:

        #!/bin/sh
        # --convert-string /home/mpsuzuki/freetype2/objs=${OBJ_DIR} \
        # --convert-string =${SRC_DIR} \
        # --convert-string /home/mpsuzuki/freetype2=${TOP_DIR} \
        # gcc -I/home/mpsuzuki/freetype2/objs \
        # -I./builds/unix \
        # -I/home/mpsuzuki/freetype2/include \
        # -DFT2_BUILD_LIBRARY \
        # -DFT_CONFIG_MODULES_H=<ftmodule.h> \
        # -I/home/mpsuzuki/freetype2/src/psnames \
        # -o /home/mpsuzuki/freetype2/objs/psnames.odep \
        # /home/mpsuzuki/freetype2/src/psnames/psmodule.c

        echo '${OBJ_DIR}/psnames.odep: ${TOP_DIR}/src/psnames/psmodule.c'

As you can see, this shell script tells the simple dependency 
rule, the pair of source file and object file. The reason "why
detailed compiler options are removed?" is that this dependency
is used to generate makefile for non-Unix platforms.

Attachment: make-odep.sh
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]