Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is this how the makefile should be write, am I making a mistake here?

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
US
Hi, I have some corba idls and then a single java file which uses these files.

the idls are in some dir and the java main is another.

here is the makefile i have writen..

Code:
IDL_SRC_LOC = /vob/acct/app/src/adsi/adsi_idl

VPATH = $IDL_SRC_LOC

IDL_SRC = $(wildcard $(IDL_LOC)/*.ild)

JAVA_BIN = /usr/vendor/jdk1.4.0/bin

IDL_JAVA_CMD = $(JAVA_BIN)/idlj

JAVA = $(JAVA_BIN)/javac

JAR = $(JAVA_BIN)/jar

IDL_GEN_JAVA_SRC = $(wildcard foreach(dir, $(IDL_JAVA_DIR), $dir)/*.java)

JAVA_SRC = $(wildcard *.java) 
#$(IDL_GEN_JAVA_SRC)

JAVA_CLASS = (JAVA_SRC:.java=.class)
	
IDL_GEN_JAVA_CLASS = (IDL_GEN_JAVA_SRC:.java=.class)

TARGET = AdsiCwiComm.jar 

DST_DIR =  

IDL_FLAGS = -fall -i $(IDL_SRC_LOC)

JAVA_FLAGS = 

JAR_FLAGS = cvmf

RESOURCES = MANIFEST.MF

all: $(TARGET)

TARGET: $(IDL_GEN_JAVA_CLASS) $(JAVA_CLASS)
	$(JAR) $(JAR_FLAGS) $(RESOURCES) $@ $(JAVA_CLASS) $(IDL_GEN_JAVA_CLASS)

IDL_GEN_JAVA_CLASS: $(IDL_GEN_JAVA_SRC)
	$(JAVA) $(JAVA_FLAGS) $?
#--Here it will compile only the java files which are newer than their class files.--


IDL_GEN_JAVA_SRC: $(IDL_SRC)
	$(IDL_JAVA_CMD) $(IDL_FLAGS) $(IDLLOC)/$?

JAVA_CLASS: $(JAVA_SRC)
	$(JAVA) ($JAVA_FLAGS) @?

I have never written a makefile, only used what my managers have provided me with, but it is becoming more and more difficult to do this..so i wanted to take this into my hand.

I know it will have many errors, but i want someone to explian me what i am doing wrong.

I have ild files, i want to make a java out of that and then class file out of that, these files will be generated in some directories like CS, CSM etc..and then once this is available I can build the main java file and then finally jar it..

so my jar depends on the IDL converted class files and java main class
IDL converted class depends on IDL converted java which depends on the IDL files.

and the java main class depends on the main java file and also the idl converted classes.

thats it..ofcourse my solution must not be the correct or even close, but i have tried, can you please help me with this, if i am wrong can you please help me go through this a little.

Thanx a ton.
Ankur
 
Thanks I will try and see what i can get from these turotials...

I am a little confused as to how to make the rules..here..

I know what depends on what but still some how i am not able to get it..

Thanks,
Ankur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top