Put .o and .exe in separate folder
Mar 18, 2008 at 11:18pm UTC
How do I have make put the .o and .exe files generated in a separate folder?
Mar 19, 2008 at 9:33am UTC
I think you should put this in the Windows Programming forum. The answer depends on which programming environment you're using (Visual Studio, Dev C++ etc.)
Mar 19, 2008 at 11:02pm UTC
I am using make, which is originally a Linux/Unix tool, but I have the MinGW version. This is not Windows-specific.
Mar 19, 2008 at 11:10pm UTC
Only windows have .exe files, so I assumed it was.
If you edit your makefiles directly, you can simply tell the compiler where to put all files. E.g.
1 2 3 4 5 6 7 8 9 10 11 12 13
BIN_DIR=bin
OBJ_DIR=.obj
TARGET=$(BIN_DIR)/program.exe
OBJECT=$(OBJ_DIR)/program.o
default : $(TARGET)
$(TARGET): $(OBJECT)
g++ -o $(TARGET) $(OBJECT)
$(OBJECT): program.cpp
g++ -c -o $(OBJECT) program.cpp
Mar 20, 2008 at 12:38am UTC
Thanks!
Topic archived. No new replies allowed.