Jump to content

Silly q: object files & hcustom - friends or foes?


Recommended Posts

Got a windows (cygwin) version running as well. It takes a good bit of effort to get cygwin running smoothly with hdk, but the make and ml_hcustom remain pretty similar. See this thread on making cygwin happy.

you'll have to edit hcustom.nt just a bit. Change this line

set IFLAGS = "$INCINC -I . -I $MSVCDir/include -I $HFS/custom/include -I $HFS/toolkit/include"

to

set IFLAGS = "$INCINC -I . -I $MSVCDir/include -I $MSVCDir/PlatformSDK/Include -I $HFS/custom/include -I $HFS/toolkit/include"

Then, in ml_hcustom, change this line:

sed /\$SHARED/s/\$CC/\#\ \$CC/g `which hcustom` | sed s/hcompile/hcompile\ -t/g > newhcustom && chmod u+x newhcustom

to

sed /\$SHARED/s/\$CC/\#\ \$CC/g `which hcustom`.nt | sed s/hcompile/hcompile\ -t/g > newhcustom && chmod u+x newhcustom

... Then the makefile is also pretty similar:

LIBDIR = 
LIBS = 
INCINC = -I ../../MLInclude/ 
files:= $(wildcard *.C)
objects:= $(files:%.C=%.o)
hcustomfile:= SOP_RibFile.C

%.o : %.C
        ./ml_hcustom $(INCINC) $<
        ar -rv libforme.a $@
        rm -f ~/houdini$(HOUDINI_MAJOR_RELEASE).$(HOUDINI_MINOR_RELEASE)/dso/$(<:.C=.dll)

$(hcustomfile:.C=.o): $(hcustomfile) $(hcustomfile:.C=.h) $(objects)
        hcustom -l libforme.a $(LIBDIR) $(LIBS) $(INCINC)  $(@:.o=.C)

clean:
        rm -f *~ *.o *.a

cleandso:
        rm -f *~ *.o *.a ~/houdini$(HOUDINI_MAJOR_RELEASE).$(HOUDINI_MINOR_RELEASE)/dso/$(hcustomfile:.C=.dll)

Note the rm in the .C -> .o rule... hcompile for windows doesn't create a .o that later gets compiled with g++, rather, it makes the actual dll in addition to the .o, SOoo every file creates a .dll in your dso dir unless you remove it. If you don't remove it/them, you'll just get some errors when you load houdini. For some reason, the rm above isn't working on my machine - I can't seem to delete files unless they are in ./ - I guess that's something weird with my cygwin setup.

So there ya go... Linux & windows makefiles for houdini. maybe this is old news to some, but it's been a pain in my side for quite some time now. :D

Link to comment
Share on other sites

I've gone the makefile route because for the life of me I couldn't get the windows hcustom to work properly when linking .lib files.

I have a strong suspicion there is a bug in there somewhere, the linux version works as you'd expect. It did give me the motivation to build a single Makefile that works across both cygwin win32 and linux for the HOT. Check out the source for an example. I had to include a modified version of Makefile.linux from the HDK due to a minor bug, apparently now fixed.

-Drew

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...