Bug 6962 - Top-level Makefile dependency rules are broken
Summary: Top-level Makefile dependency rules are broken
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.8.0
Assignee: Peter Åstrand
URL:
Keywords: ossman_tester, prosaic
Depends on:
Blocks:
 
Reported: 2017-04-26 12:55 CEST by Peter Åstrand
Modified: 2017-05-04 14:23 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Peter Åstrand cendio 2017-04-26 12:55:38 CEST
In the toplevel Makefile, we have standardized on using "order-only prerequisites", using the "|" construction. These are not working as intended. Example:

.PHONY: client-osx-iso
client-osx-iso:
	cbrun osx64 $(MAKE) -C client $(CLIENT_OSX_ISO_NAME)
client/$(CLIENT_OSX_ISO_NAME): | client-osx-iso
$(CLIENT_OSX_ISO_ONCD): client/$(CLIENT_OSX_ISO_NAME)
	mkdir -p `dirname $@`
	cp $< $@

If client/$(CLIENT_OSX_ISO_NAME) exists but the client needs to be rebuilt, the rebuild will happen, but make will conclude that no mkdir/cp needs to be done. This is because the time stamp comparision happens before the rebuild. There's a better way do write:

.PHONY: client-osx-iso
client-osx-iso: client/$(CLIENT_OSX_ISO_NAME)
client/$(CLIENT_OSX_ISO_NAME): FORCE
	cbrun osx64 $(MAKE) -C client $(CLIENT_OSX_ISO_NAME)
$(CLIENT_OSX_ISO_ONCD): client/$(CLIENT_OSX_ISO_NAME)
	mkdir -p `dirname $@`
	cp $< $@

Besides working correctly, it is easier to read.
Comment 2 Pierre Ossman cendio 2017-05-04 14:23:35 CEST
Seems to trigger properly now.

Note You need to log in before you can comment on or make changes to this bug.