Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,when i downloaded some app linux,in most them
is there some file name makefile?
when i search i faced with cmake?
whats cmake?what application them?
this is part of a makefile:
dir := .
makemode := misc

DISTFILES := configure

include ./Makeconf

## Subdirectories of this directory should all be mentioned here

# Hurd libraries
lib-subdirs = libshouldbeinlibc libihash libiohelp libports libthreads \
	      libpager libfshelp libdiskfs libtrivfs libps \
	      libnetfs libpipe libstore libhurdbugaddr libftpconn libcons

# Hurd programs
prog-subdirs = auth proc exec term \
	       ext2fs isofs tmpfs fatfs \
	       storeio pflocal pfinet defpager mach-defpager \
	       login daemons boot console \
	       hostmux usermux ftpfs trans \
	       console-client utils sutils \
	       benchmarks fstests \
	       random \
	       procfs \
	       startup \
	       init \

ifeq ($(HAVE_SUN_RPC),yes)
prog-subdirs += nfs nfsd
endif

# Other directories
other-subdirs = hurd doc config release include

# All the subdirectories together
subdirs = $(lib-subdirs) $(prog-subdirs) $(other-subdirs)

# This allows the creation of a file BROKEN in any of the prog-subdirs;
# that will prevent this top level Makefile from attempting to make it.
working-prog-subdirs := $(filter-out \
			  $(patsubst %/,%,\
				 $(dir $(wildcard $(prog-subdirs:=/BROKEN)))),\
			  $(prog-subdirs))


$(subdirs): version.h

what language uses for makefile?
i know it uses for installing my aap.
please guide me.

What I have tried:

i even downuloaded cmake for window but i didn't any idea about
making file.
Posted
Updated 7-Mar-16 14:28pm
v3

A make file is a "Build it like this" list that together with the application - cmake - allows you to provide dependancies:
This C file uses:
  This .H file
  That .H file

This .H file uses:
  TheOther .H file

This EXE file uses:
  This .C file
  That .C file
So if "TheOther.H" file is changed, it knows it has to rebuild everythign that uses "This.H" file, which includes "This.C" and "This.EXE".
It also includes the instructions to build them: compiler to use, switches, and so forth.

It means you don't makes mistakes when you build complex projects and "forget" a file because you didn't realize it used a structure you changed in a header file, while not wasting time building everything unnecessarily.
 
Share this answer
 
Comments
Albert Holguin 7-Mar-16 20:33pm    
I tried to detail the process out a little more since I work with Linux quite a bit...
stackprogramer 8-Mar-16 1:17am    
thanks yes i linux i had these problems
A "makefile" is a list of instructions for "make" on how to build:
0. The objects that are generated from every source file. This is accomplished by the compiler.
1. The libraries and or executables that you are building (if any). Keep in mind, a library is a collection of objects that you've compiled. This is accomplished by the linker (or archiver when building static libraries).

Since it's multiple programs that you'd have to call to build every single object and library, all this is compiled into a makefile that is processed by a helper program called "make".

CMake is a cross-platform simplified version of make (supports various OS's and cross-compiling, targeting a different architecture than the one you're building on). It builds in a lot of the library search routines that weren't readily available in make and just makes the whole process a lot easier and cleaner to deal with (allows out-of-source builds to keep your source clean of build products). The product of running CMake is a set of linked makefiles.

In a typical cmake build you'd...
0. Create a build directory to put everything in (this is where "out-of-source" building comes in):
Python
# go to your source code root directory
cd /source/path
# build everything in our build directory 
#   "make" used to "build in place"...
#   polluting your source with object files and other build products)
mkdir build
cd build
# cmake arguments start with D, common argument is installation path
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/

1. Call make to compile and link (use -j argument to use more threads)
C++
make

2. Call make w/ install argument to install to configured path
C++
make install
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900