This forum has been archived. Please start a new discussion on GitHub.

HELP compiling !!

Hi I made a ice project in c++ code but i have to compile this project in two machines but the problem is in one machine Ice is in top level directory( I have to use ICE_HOME and in the other machine it is in opt/ICE How can I write it in makefile. My makefile for ICE_HOME is below:

CFLAGS=-I. -g -Wall -I$ICE_HOME/include
OBJECTS=client_mud.o se_linux_mud.o

client: $(OBJECTS)
$(CC) -o client $(OBJECTS) \-L$ICE_HOME/lib -lIce -lIceUtil -lreadline

client_mud.o: client_mud.cpp
$(CC) $(CFLAGS) -c client_mud.cpp -o client_mud.o

se_linux_mud.o: se_linux_mud.cpp
$(CC) $(CFLAGS) -c se_linux_mud.cpp -o se_linux_mud.o

How can I write it that it also compiles in machine that ice is in opt/Ice. I want a write it like that the compiler will find the include files.



  • bernard
    bernard Jupiter, FL
    If you use GNU make (gmake), you could add:

    ICE_HOME ?= /opt/ICE

    to get the ICE_HOME variable defined to /opt/ICE when it's not yet defined.

    Please note that this forum is for Ice questions, not make (C++, Java) etc.