Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create an archive for a given folder but without the folders name in the path...

In fact I want to do the same thing that this post : Avoid unwanted path in Zip file

BUT I'm in a makefile and the following code doesn't work :

zip -r dist/$(ARCHIVE) $(PROJECT_FOLDER)

It is like cd is not done and finaly the archive is well created but with the $(PROJECT_FOLDER) folder at the beginning.

Do you know how to do this ?

share|improve this question
up vote 2 down vote accepted

Each command line in a Makefile is launched into a separate shell process.  To get a cd to work, do


i.e., all on one line.

Optionally, for clarity, you could say

zip -r dist/$(ARCHIVE) $(PROJECT_FOLDER)

i.e., make it one logical line, but break the pieces into separate physical lines.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.