Can a makefile have a directory as a target?

Yes, a Makefile can have a directory as target.

Your problem could be that the cd doesn’t do what you want: it does cd and the git clone is carried out in the original directory (the one you cded from, not the one you cded to). This is because for every command in the Makefile an extra shell is created. A workaround is to run cd and clone as one command with the shell’s &&.

This should work:

bla/f: dir
    cd dir && touch f

dir:
    mkdir dir

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)