All pastes #1535839 Raw Edit

make and nmake in a single Makef

public text v1 · immutable
#1535839 ·published 2009-08-20 01:21 UTC
rendered paste body
# Magic make/nmake Makefile
# The trick used here is that GNU make allows comment lines 
# to be continued with a \ character, while nmake does not.
# Please don't touch the marked lines unless you know what
# you're doing.

# This block is common to both
all: foo

#            DON'T TOUCH \
!IF 0 #      DON'T TOUCH
ifeq (0,1) # DON'T TOUCH \
!ENDIF #     DON'T TOUCH

# This block is nmake only
foo:
	@echo nmake

#        DON'T TOUCH \
!IF 0 #  DON'T TOUCH
endif #  DON'T TOUCH \
!ENDIF # DON'T TOUCH

#       DON'T TOUCH \
!IF 0 # DON'T TOUCH

#This block is make only
foo:
	@echo make


#        DON'T TOUCH \
!ENDIF # DON'T TOUCH