1. Directory structure
Practice6/ui/ui.h UI.C
Practice6/dal/dal.h DAL.C
Practice6/bll/bll.h BLL.C
Practice6/main.c
Pracitce6/makefile
2, makefile Writing and description
CC =gcc CFLAGS=-wall-g BIN= Main. outSubDir= $ (Shell ls-d */)//Call the shell command ls-d * * List the subdirectories of the current directory, not the files in the current directoryROOTSRC = $ (wildcard *.c)//$ (wildcard *.c) to find *.c files/folders from the current directoryRootobj = $ (rootsrc:%.c =%.o)//Replace the string ending with. C in the ROOTSRC string with the string ending in. O,%.c is the gnumake, equivalent to the Shell's *.cSUBSRC = $ (Shell find $ (subdir)-name'*.c')//call the shell command to find all files named *.c in subdirectories of the current directorySubobj = $ (subsrc:%.c =%.o)//Replace the string ending with. O in the SUBSRC string with the string ending in.$ (BIN): $ (rootobj) $ (subobj)//gcc generates main.out files$ (CC) $ (CFLAGS)-o [email protected] $^. C.O://indicates that the. c file depends on the. o File$ (CC) $ (CFLAGS)-C $<-o [Email protected]clean:rm-F $ (BIN) $ (rootobj) $ (subobj)
3. Process and
Not to be continued ...