Makefile Question

I wasn't sure whether to post this question under unix/linux programming so forgive me if this is the wrong forum section.

I made a makefile that has a recipe as follows:

run :
cd ..
other stuff

When I do this I get the following error:
1
2
The system cannot find the path specified.
make: *** [run] Error 1


So I tried to see if I could get around this using pushd .. but got this error:
1
2
3
process_begin: CreateProcess(NULL, pushd .., ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [run] Error 2


My goal is to use this makefile for packages in java. Since I can't have more than one makefile in a directory I thought if I just put it in a folder for each respective class(es). By having a make run I can execute test clients of classes in the package. Likewise I'd eventually like to employ this technique with c++.

How can I use make to cd?
Last edited on
http://stackoverflow.com/questions/1789594/how-to-write-cd-command-in-makefile

> Since I can't have more than one makefile in a directory
you can
make [-f makefile]
Last edited on
Sorry my bad a makefile without a .mak extension. Either way adding semi-colons adds this problem to cd ..
1
2
The filename, directory name, or volume label syntax is incorrect.
make: *** [run] Error 1
The problem here is that even when I use the command cd .. it does not actually change directories. I tried cd ..&&myJavaCommand and it deos not recognize the shell in a new directory.
Topic archived. No new replies allowed.