]> zdv2.bktei.com Git - BK-2023-05.git/blobdiff - README.org
feat(src/kr):Save state of source files
[BK-2023-05.git] / README.org
index b900546ac6f72923dd2d81217c8ebcfbd35ccbf7..a79bb3b99f1815c9d379dce1795be35840962c7d 100644 (file)
@@ -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~.