Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1337043
  • 博文数量: 482
  • 博客积分: 13297
  • 博客等级: 上将
  • 技术积分: 2890
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-12 16:25
文章分类

全部博文(482)

文章存档

2012年(9)

2011年(407)

2010年(66)

分类: LINUX

2011-09-04 15:02:08

dwm is customised by editing config.h, a C language header file, and config.mk, a Make include file.

What is config.h?

config.h is a source code file which is included by dwm.c, the main dwm source code module. It serves as the configuration file for all of dwm’s features, e.g., application placement, tags, and colours. A vanilla download of dwm will contain a file called config.def.h, a template you can use to create your own config.h file. To start customising dwm, simply copy config.def.h into config.h before you run make.

What is config.mk?

config.mk is a file included by Makefile. It allows you to configure how make is going to compile and install dwm.

How do I modify config.h?

config.h can be edited just like any other C source code file. It contains definitions of variables that are going to be used by dwm.c and therefore it is vital that the file is always up to date. The default Makefile distributed with dwm will not overwrite your customised config.h with the contents of config.def.h, even if it was updated in the latest mercurial pull. Therefore, you should always compare your customised config.h with config.def.h and make sure you include any changes to the latter in your config.h.

How do I modify config.mk?

config.mk can be edited just like any other text file. It contains definitions of variables that are going to be used inside Makefile. Unlike config.h, config.mk does not have a config.def.mk (a default Makefile). Therefore, during an update of your repository you may run into conflicts if the original config.mk is edited.

Are there any example customisations to get me started?

Various customisation options are illustrated in the sub-directories of this wiki page. Under each of the categories (customfuncs, fonts, etc.,) you will find example modifications that will get you started.

====

http://dwm.suckless.org/customisation/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

./configure, automake, autoconf and the like


Source code (especially C/C++) must be compiled differently on different platforms. Aggravating is the fact that some (library-) functions are not present on all platform (for example gettimeofday). This poses problems if the same source code is to be compiled on different platforms.
In order to tackle this problem, GNU proposes a two step build mechanism involving configure, , and the like.
Essentially, it boils down to a standard build process for a program like so:
./configure make make install
Invoking configure creates a config.status file, which is a shell script. config.status is used to convert into the Makefile. config.status also turnes config.in into config.h
./configure also creates a config.cache file. config.cache should be removed if configure.in is significantely changed.
Lastly, ./configure creates a stamp-h.in file.
On the installer machine, nothing more than a bourne shell, a c compiler and a make programm are needed.
The programmer additionally needs the , the and .
configure's behaviour can be changed through its .
configure.in configure.scan
can be used to create a configure.scan file which can be used as a starting point for a configure.in file.
Makefile.am
Makefile.am is a simple specification of a project's build requirements that will be turned into a fully fledged .
A typical Makefile.am has the form
variable=value
Most Makefile.am assigns values to the following variables:
  • INCLUDES
  • LDFLAGS
  • LDADD
  • EXTRA_DIST
  • SUBDIRS
  • bin_PROGRAMMS ??? see below
    This variable defines a list of programs to be installed in the $(prefix)/bin directory.
  • lib_LIBRARIES
  • check_PROGRAMS
    Lists the programs that are needed to run
  • TESTS
    Lists the programs that are run Because those programs sometimes need to be built themselves, usually one wants to write
    TESTS = $(check_PROGRAMS)
Additionally, for each program, the following variables must be assigned to:
  • prog_SOURCES
  • prog_LDADD
  • prog_LDFLAGS
  • prog_DEPENDENCIES
For each library, the following variables must be assigned to:
  • lib{library_name}_SOURCES
  • lib{library_name}_LDFLAGS
  • lib{library_name}_DEPENDENCIES
Super targets
  • bin_PROGRAMMS
    ??? see above
  • bin_SCRIPTS
  • man_MANS
  • lib_LTLIBRARIES
  • noinst_PROGRAMMS
Makefile.in Makefile
Usually, the Makefile is generated by ./configure from
Targets
  • all
  • check
    See also and
  • install
  • clean
acconfig.h
acconfig.h is the file out of which is generated.
config.h.in
config.h.in (or config.in, see ) is the file out of which is generated.
can be used to create an initial config.h.in.
config.h config.guess config.log
Use this file when something went wrong with ./configure.
config.status
config.status is a shell script that may be used to recreate the current configuration. That is, all generated files will be regenerated.
Can also be used with
How they interact
On is a generated graphic that illustrates (or at least: tries to) how the tools interact and which files they produce.
Examples

====

阅读(1777) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

Alan05212011-09-04 16:36:49

config.mk 是config Makefile的。