joplin-notes/joplin notion extension/Web Development/C_C++/GTK/MakeFile.md
2026-11-04 00:33:23 +05:30

824 B

MakeFile

# default target name: sourceFile of gtk 
# compilation command

# target: prequisites
#	action

mygtkapp: mainGTKapp.c
	gcc `pkg-config --cflags gtk+-3.0` -o main mainGTKapp.c `pkg-config --libs gtk+-3.0`



For making it more readable macros will be used

# macros
PROG = main

CC = gcc
CFLAGS = `pkg-config --cflags gtk+-3.0`
LIBS= `pkg-config --libs gtk+-3.0`



# default target name: sourceFile of gtk 
# compilation command

# target: prequisites
#	action

# mygtkapp: mainGTKapp.c
# 	gcc `pkg-config --cflags gtk+-3.0` -o main mainGTKapp.c `pkg-config --libs gtk+-3.0`


${PROG}: ${PROG}.c
	${CC} ${CFLAGS} -o ${PROG} ${PROG}.c ${LIBS}

# Make another argument clean
clean:
	rm ${PROG}


Use make to create the executable file and use make clean to remove executable