Jump to content

Custom Vop Ops


Recommended Posts

Hey Sven,

If you're using Linux, then copy the following into a file called "Makefile" (no extensions) and put it in the same directory where you're writing your .vfl sources. Then type "make" to make all your shaders (into otls) or "make clobber" to un-make things.

# This is where the otls will be placed. Feel free to change it
OTLDIR      = ./otls

# This should have all locations where include files are (if any)
VEXINC      = -I. -I./include       # these are just examples for syntax

# This should have any special defines (if any)
VEXDEF      = -DSHADER -Dush_vex    # these are just examples for syntax


#-----------------------------------------------------------------------------
# You should be able to leave what follows alone
#-----------------------------------------------------------------------------
MAKEDEPEND  = cpp -M 

VFLSRCS     = $(wildcard *.vfl)
OTLS        = $(VFLSRCS:%.vfl=$(OTLDIR)/%.otl)

.PHONY: all clobber tell 
all: $(OTLS) 

$(OTLDIR)/%.otl : %.vfl
	@mkdir -p $(OTLDIR)
	@echo Building Dependencies for $< ...
	@$(SHELL) -ec '$(MAKEDEPEND) $(VEXINC) $(VEXDEF) -MT $@ $< \
	             | sed -e '\''s/\($*\)\.otl[ :]*/$*.otl $*.d : /g'\'' > $*.d; \
	             [ -s $*.d ] || rm -f $*.d'
	@echo Compiling and building OTL from $< ...
	vcc $(VEXINC) $(VEXDEF) -L $@ $<


-include $(VFLSRCS:.vfl=.d)

clobber:
	@/bin/rm -f $(OTLS) ./*.d

tell:
	@echo VFLSRCS = $(VFLSRCS)
	@echo OTLS = $(OTLS)

It's just a quickie make file to make your life easier, but if you're using Windoze... well... dunno. Maybe a kind soul can post a similar thing for Windows users (?) :unsure:

Does gnuMake work in windows? or would you need the whole MSVisual-blah-blah just to run make?

HTH.

<EDIT>

Oooops... I just realized that the TAB characters might not survive if you just copy-paste the code above (TABs are important in Makefiles). So here it is as a file:

Makefile.zip

</EDIT>

Link to comment
Share on other sites

Yes, we use GNU Make on Windows all ths time.

24355[/snapback]

Ah, thanks Ed. That's good to know.

So I got curious and googled around a bit and noticed there are a few native ports of some unix tools, and then there's cygwin... do you use cygwin to get the whole environment, or go with the native port of some of the bits and pieces?

I also noticed MinGW, and djgpp, and... it gets a little confusing in windows land :unsure:

The little makefile snippet above for example, would need cpp and sed (+some shell)... or just use something else to scan for dependencies I guess...(?)

Let's say you're writing Houdini plugins (non-UI dso/dll), and you're developing on Linux (traditional text editor+makefiles, etc), what would you recommend as a good toolset for porting to Windows in the least painful way possible?

In this case you'd have to use MSVC, so the open question for me is: could you run the MS compiler from a cygwin/make environment? (or would you even want to?)

Or is it a case of just biting the bullet and manually turning all your build scripts into MSVC "projects"? Or use some third-party cross-platform build system? Or...

Mario Clueless-In-Windows Marengo.

P.S. uhmmm.... I just went waaaaay off topic didn't I... sorry :(

Link to comment
Share on other sites

Guest xionmark
In this case you'd have to use MSVC, so the open question for me is: could you run the MS compiler from a cygwin/make environment? (or would you even want to?)

Or is it a case of just biting the bullet and manually turning all your build scripts into MSVC "projects"? Or use some third-party cross-platform build system? Or...

24375[/snapback]

By using hcustom in a WIN environment I have no need to create MSVC "projects", I just use the IDE for the "language sensitive" editor, all compilations occur via tcsh(CygWIN) and hcustom. Works fine.

I'd rather stay in *NIX land but you know the drill ...

--Mark

Link to comment
Share on other sites

By using hcustom in a WIN environment I have no need to create MSVC "projects", I just use the IDE for the "language sensitive" editor, all compilations occur via tcsh(CygWIN) and hcustom.  Works fine.

24380[/snapback]

Thanks Mark.

Yup. That's definitely painless :)

But let's say things get more complicated and your plugins need to make use of other libraries you've written, which in turn need to be compiled/built in a way that's compatible with Houdini, etc. IOW: say you need something more controllable than hcustom... what do people like to do then?

Link to comment
Share on other sites

Guest xionmark
Thanks Mark.

Yup. That's definitely painless :)

But let's say things get more complicated and your plugins need to make use of other libraries you've written, which in turn need to be compiled/built in a way that's compatible with Houdini, etc. IOW: say you need something more controllable than hcustom... what do people like to do then?

24382[/snapback]

You can always roll your own makefile, I think Brian (from Martian Labs) posted something about that on odforce or you can pass the libs/include dirs to hcustom via the usual "-L", "-l" and "-I" switches (but you probably already know that!). :)

--Mark

Link to comment
Share on other sites

You can always roll your own makefile, I think Brian (from Martian Labs) posted something about that on odforce or you can pass the libs/include dirs to hcustom via the usual "-L", "-l" and "-I" switches (but you probably already know that!).  :)

--Mark

24383[/snapback]

Yes, that's my question. I already roll my own make files in Linux and build things that way. But "rolling your own makefiles" in windows likely takes a different approach and toolset, and so my question: what's the least painful way to move a Linux-centric compile/build system to windows?

I'll look around for Brian's post. Thanks.

[Edit]

Found it here. And yes, it looks like it's possible going the cygwin route.

Thank you Mark and Brian!

[/Edit]

Link to comment
Share on other sites

Guest xionmark
It's all done for you already. Just include $HT/makefiles/Makefile.gnu

24390[/snapback]

Whoah! I've never looked there before ...

Thanks Edward!

--Mark

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...