Run script before compilation in Makefile

Posted by Werner on Stack Overflow See other posts from Stack Overflow or by Werner
Published on 2010-03-26T16:14:23Z Indexed on 2010/03/26 16:23 UTC
Read the original article Hit count: 290

Filed under:

Hi,

in a Makefile, I have:

all: $(PROG)

$(PROG): $(CPP_OBJS)
        $(CPP_LD) $(CPP_LD_FLAGS) $(CPP_OBJS)  -o $(PROG)

I would like to add some script before the compilation so I tried:

all: $(PROG)

$(PROG): $(CPP_OBJS)
        sh script.sh ; $(CPP_LD) $(CPP_LD_FLAGS) $(CPP_OBJS)  -o $(PROG)

but it does not work.

What is the right way of running a script in this case before the compilation?

Thanks

© Stack Overflow or respective owner

Related posts about makefile