简体   繁体   中英

Makefile always call all even with target

Okay, I think I'm missing something in my makefile and it's causing me headaches. In my local build I call it with "dev:" and it does the dev target; Great, but I also want it to always do the "all:" target. When I call make dev it runs the dev but not the all, is there a terminology fail here?

here is my makefile

BUILD="build/"
STATIC="static/"
APP_NAME="Open World"

all:
    # Remove the current build folder
    rm -rf ${BUILD}

    # Create the build directory
    mkdir -p ${BUILD}

dev:
    all
    dev=${STATIC}dev

    echo "Doing DEVELOPMENT build"

    # Copy the package.json
    cp ${dev}package.json ${BUILD}

prod:
    echo "production"

The default (first) target is only run if no target is explicitly given. If you want it to run when another target is given then you need to make it a dependency of that target.

dev: all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM