Skip to content

Instantly share code, notes, and snippets.

@bvpav
Last active November 3, 2022 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvpav/3a8a2a00131886db8dedc768c0ac3fb3 to your computer and use it in GitHub Desktop.
Save bvpav/3a8a2a00131886db8dedc768c0ac3fb3 to your computer and use it in GitHub Desktop.
Примерни Makefile-ове
# това е коментар
# всичко тук отдолу се наричат рецепти
# на английски език, структурата на една рецепта:
target: prerequisite1 [prerequisite2 ...]
command1
[command2 ...]
#^^^ имай предвид, че тази индентация тук е задължителна - с нея разбира, че това е част от рецептата
# ЗАДЪЛЖИТЕЛНО използваш tab тук за индентация. интервали не работят.
# Бележка: може би би желал да използваш по-дълга команда за компилиране, като включиш неща като -Wall -Werror ...
tictactoe: main.o find_best_move.o evaluate_move.o find_empty.o print_board.o
gcc main.o find_best_move.o evaluate_move.o find_empty.o print_board.o -o tictactoe
main.o: main.c
gcc -c main.c -o main.o
find_best_move.o: find_best_move.c
gcc -c find_best_move.c -o find_best_move.o
evaluate_move.o: evaluate_move.c
gcc -c evaluate_move.c -o evaluate_move.o
find_empty.o: find_empty.c
gcc -c find_empty.c -o find_empty.o
print_board.o: print_board.c
gcc -c print_board.c -o print_board.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment