Friday, December 3, 2010

About the Linux operating system instance detailed analytic makefile three directives:

(1) ifeq: contains two parameters, separated by commas, and is enclosed in parentheses.

Ifeq and left parenthesis between spaces (2) (3) endif else: end conditional statements. Example 1: TARGET = helloworldCC = gccCFLAGS =-Wall-O-gSRC = $ (wildcard * .c) OBJS = $ (patsubst% .c,% .o, $ (wildcard * .c)) $ (TARGET): $ (OBJS) $ (CC) $ (CFLAGS) $ (OBJS)-o @ # $ (RM) * .o%. o:%.c $ (CC) $ (CFLAGS)-c $ <-o@clean:rm-rf*.ohelloworld例二:vpat=objects=mmain.o. child/pcild.otarget=""><-o@pchild.o:pchild.cpcild.$(cc)-c$^-o@ 例三:vpat=objects=mmain.o./pchild/pcild.oyesno=noifeq($(yesno),yes)target=mmelsetarget=nnendicc=ccall:$(target)$(target):$(objects)$(cc)$(objects)-o@rm-f$(objects) 例三:vpat="">

No comments:

Post a Comment