-
-
Save medicalwei/1158e6ba0426ffe53267edda381d6108 to your computer and use it in GitHub Desktop.
Makefile dependency example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is file A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INTERMEDIATES := B1 B2 B3 | |
OBJS := B1Y1 B1Y2 B1Y3 B2Y1 B2Y2 B2Y3 B3Y1 B3Y2 B3Y3 | |
.PHONY: all | |
all: $(OBJS) | |
clean: | |
rm -f $(INTERMEDIATES) $(OBJS) | |
B1: A | |
cp $< $@ | |
echo "Through rule X1" >> $@ | |
B2: A | |
cp $< $@ | |
echo "Through rule X2" >> $@ | |
B3: A | |
cp $< $@ | |
echo "Through rule X3" >> $@ | |
%Y1: % | |
cp $< $@ | |
echo "Through rule Y1" >> $@ | |
%Y2: % | |
cp $< $@ | |
echo "Through rule Y2" >> $@ | |
%Y3: % | |
cp $< $@ | |
echo "Through rule Y3" >> $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment