Skip to content

Instantly share code, notes, and snippets.

@tralamazza
Created March 2, 2019 13:13
Show Gist options
  • Save tralamazza/c146be11592c3d8900e867f984525776 to your computer and use it in GitHub Desktop.
Save tralamazza/c146be11592c3d8900e867f984525776 to your computer and use it in GitHub Desktop.
simple way to compile ragel examples (one source per executable)
RAGELFILES:= $(wildcard *.rl)
EXECUTABLES:= $(patsubst %.rl, %, $(RAGELFILES))
LDFLAGS+= -lstdc++
%.cc : %.rl
ragel -G2 -C -o $@ $<
all: $(EXECUTABLES)
clean:
rm -vf $(EXECUTABLES)
# Uncomment this to preserve the generated .cc files
# .SECONDARY: $(patsubst %.rl, %.cc, $(RAGELFILES))
.PHONY: all clean
@tralamazza
Copy link
Author

Assumes C++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment