Sign in to follow this  
aftermath

Something is wrong with my Makefile, please help?

Recommended Posts

aftermath    100
Something is wrong with this Makefile for an installer for an application that I am developing at work. It is supposed to, in the end, create the file located at cd/autorun.inf but every time I run make it re-builds everything from ground-zero (all dependencies are build, even if they ARE updated.) Can anyone find any obvious mistakes here? [help] Thanks.
# Makefile for installer

CLIENT_APP_VERSION_STRING="1.0.6"
CLIENT_APP_PRODUCTNAME="Fake"
CLIENT_APP_PRODUCTCOMPONENT="Foo"
CLIENT_APP_ORIGINALFILENAME=$(CLIENT_APP_PRODUCTNAME)$(CLIENT_APP_PRODUCTCOMPONENT)-$(CLIENT_APP_VERSION_STRING).exe

MAKE_NSIS="makensis"

.SUFFIXES: .rtf

# autorun.inf is the last file to be created
all: cd/autorun.inf

clean:
	rm -rf final
	rm -rf cd
	rm -f eula.con
	rm -f eula.ref
	rm -f eula.pds
	rm -f $(CLIENT_APP_ORIGINALFILENAME)

# Autorun file for CD
cd/autorun.inf: cd
	echo [autorun] > $@
	echo open=$(CLIENT_APP_ORIGINALFILENAME) >> $@
	echo icon=install.ico >> $@

# Final CD directory
cd: $(CLIENT_APP_ORIGINALFILENAME) install.ico
	mkdir $@
	cp --target-directory=$@ $^

# The installer executable
$(CLIENT_APP_ORIGINALFILENAME): final eula.rtf
	$(MAKE_NSIS) /DAPP_VERSION_STRING=$(CLIENT_APP_VERSION_STRING) 	/DAPP_PRODUCTNAME=$(CLIENT_APP_PRODUCTNAME) 	/DAPP_PRODUCTCOMPONENT=$(CLIENT_APP_PRODUCTCOMPONENT) 	/DAPP_ORIGINALFILENAME=$(CLIENT_APP_ORIGINALFILENAME) 	client.nsi

final:
	mkdir $@
	cp ../client/client.exe $@
	cp -r ../client/profiles $@
	rm -rf `find $@ -name ".svn" -type d`

# TeX -> RTF
.tex.rtf:
	tex2rtf $< $@

Share this post


Link to post
Share on other sites
aftermath    100
Quote:
Original post by igni ferroque
Not seeing anything immediately. Have you checked if it's a file modification date issue?

*bump*

Does make take a directory as a target the same way it does as with a file?

Share this post


Link to post
Share on other sites
Zahlman    1682
I don't know whether it accepts the directory as part of the target, but I just thought I'd point out that in order for it to work, it'd have to accept the directory as a *dependancy* too. That might be problematic: it might decide to rebuild "cd" from scratch because it doesn't see a *regular file* "cd".

If that's the real problem, you might try hacking it like this:

# Autorun file for CD
cd/autorun.inf: cd_built
# do the necessary stuff

# Final CD directory
cd_built: $(CLIENT_APP_ORIGINALFILENAME) install.ico
# Create cd directory
touch cd_built # i.e. create a *file* indicating that the dependancy is satisfied

But I'm completely guessing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this