Skip to content

Instantly share code, notes, and snippets.

@hempnall
Created February 19, 2018 19:53
Show Gist options
  • Save hempnall/8ca64443df7c570d4bd6a253df02d388 to your computer and use it in GitHub Desktop.
Save hempnall/8ca64443df7c570d4bd6a253df02d388 to your computer and use it in GitHub Desktop.
Wildcards in Makefiles
txt_files := $(wildcard *.txt)
int_files := $(txt_files:.txt=.int)
hexdump_files := $(int_files:.int=.hexdump)
all:
echo $(txt_files)
echo $(int_files)
echo $(hexdump_files)
$(hexdump_files): $(INT_FILES)
%.hexdump: %.int
cp $< $@
%.int: %.txt
cp $< $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment