X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2023-05.git/blobdiff_plain/5575c6f8462f39aad7708e345c5464f996ef6c84..812b892f37231bb1234b64d8c8fc2e603c210d84:/README.org diff --git a/README.org b/README.org index b900546..a79bb3b 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,33 @@ * Learning C +#+TITLE: Learning C +#+AUTHOR: Steven Baltakatei Sandoval +#+DATE: 2023-07-10 +#+EMAIL: baltakatei@gmail.com + ** Summary This repository contains practice code and examples as I learn how to program in C. + +** Compiling Procedure +*** Compiling with ~gcc~ +See [[https://www.linuxtopia.org/online_books/an_introduction_to_gcc/gccintro_9.html][ref]]. + +: $ gcc -Wall -o hello.c hello + +*** Managing compiling with ~make~ +Create ~Makefile~ to specify compile options. + +#+begin_example +CC=gcc +CFLAGS=-Wall -Wextra -pedantic +OUTFILE=hello +SOURCE=hello.c + +all: $(SOURCE) + $(CC) $(CFLAGS) -o $(OUTFILE) $(SOURCE) + +clean: + rm -f $(OUTFILE) +#+end_example + +Then, run the file named ~Makefile~ via ~make all~ or simply ~make~.