824 B
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