Moatasem-Elsayed / MakeFile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MakeFile

channel on Youtube : https://www.youtube.com/channel/UCHTjN5FEITwRyb4IA3F8c4Q/playlists

what is Make ?

  • Make is a scripting tool is used for building executable according to commands
  • Make tool parse an input file " Makefile" to define rules that it will run
  • two types of Make ( GNU Make - Borland Make)

Why we need Make ?

  • to organize the compilation process
  • to run our tools and scripts
  • to automate the process
  • to be fully control on the outputs and its time

Basic Syntax

  1. setting rule
 
 Target : prerequisites
<tab> Recipe

  1. Define Variable

files = main.cpp
files += hello.cpp

  1. substitute variable

echo $(files)

  1. Disaple Echo

    Using @ ex :


@echo "hello"

  1. Access Enviroment Variable

    it is accessible ex :


echo $(PATH)

  1. Access shell commands

    example

     clean:
  		  
      @rm *.o
  		  @echo "`date` done" > log.txt

  1. Access external scripts

    example


  test:
  		  python analysis.py

About


Languages

Language:Makefile 80.8%Language:C 12.4%Language:C++ 5.2%Language:Python 1.6%