Something is wrong with my Makefile, please help?

Started by
3 comments, last by Zahlman 19 years, 4 months ago
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 $< $@

Rate me up.
Advertisement
Not seeing anything immediately. Have you checked if it's a file modification date issue?
Free Mac Mini (I know, I'm a tool)
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?
Rate me up.
Can anyone tell me if make takes a directory or a file in a directory as a target? For example, is a target sutch as cd/autorun.inf legal?

thanks
Rate me up.
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 CDcd/autorun.inf: cd_built	# do the necessary stuff# Final CD directorycd_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.

This topic is closed to new replies.

Advertisement