Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

generated command #88

Open
jjacobsson opened this Issue · 6 comments

2 participants

@jjacobsson

I tried to use a resulting executable from linking in a command and tup fails with

tup error: Unable to create command 'fptest.exe' because the node already exists in the database as type 'generated file'
tup error: Error parsing Tupfile line 29

My rules are:

: foreach *.cpp |> !cc |> 
: *.obj |> !exe |> fptest.exe
: |> fptest.exe |> image.jpg

Implement cc & exe rules as appropriate for your tool chain.

@gittup
Owner
@jjacobsson

Sorry for not getting back until now.

Yes the workaround works. Thanks!

Maybe not the most elegant solution for a civilized age but it does work. :)

@jjacobsson jjacobsson closed this
@jjacobsson

After some further testing...

This will indeed cause the built command to be executed. But, since the command is different than the produced file, tup fails to realize the dependency properly and thus runs the command before linking when you build a second time.

Maybe a different issue, but I will re-open this for visibility for now...

Rules now look like this:

: foreach *.cpp |> !cc |> {objs}
: {objs} |> !link_exe |> fptest.exe
: fptest.exe |> ./fptest.exe |> image.jpg
@jjacobsson jjacobsson reopened this
@gittup
Owner
@jjacobsson
DEFINES += /D_DEBUG
DEFINES += /DDEBUG
DEFINES += /D_CONSOLE
DEFINES += /D_CRT_SECURE_NO_WARNINGS
DEFINES += /D_UNICODE
DEFINES += /DUNICODE

CCFLAGS += /nologo
CCFLAGS += /c
CCFLAGS += /errorReport:prompt
CCFLAGS += /wd4530
CCFLAGS += /wd4305
CCFLAGS += /wd4244
CCFLAGS += /W3
CCFLAGS += /TP
CCFLAGS += /Od
CCFLAGS += /Z7

LINKFLAGS += /nologo
LINKFLAGS += /DEBUG
LINKFLAGS += /INCREMENTAL:NO
LINKFLAGS += /SUBSYSTEM:CONSOLE

!link_exe = |> ^ Linking %o^ link $(LINKFLAGS) %f /OUT:%o /PDB:%O.pdb |> %O.pdb %O.ilk
!cc = |> ^ Compiling %f^ cl %f $(CCFLAGS) $(DEFINES) /Fo%B.obj |> %B.obj 

: foreach *.cpp |> !cc |> {objs}
: {objs} |> !link_exe |> fptest.exe
: fptest.exe |> ./fptest.exe |> image.jpg

That is my full Tupfile. And as you see I'm using Visual Studio (actually just the Windows SDK) :)

Os is Windows 7 64bit.

What I notice is that on the first upd, when fptest.exe does not exist everything runs correctly. If I change a source file and run upd again, fptest.exe will execute before the files are compiled/linked again.

@gittup
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.