Skip to content

Instantly share code, notes, and snippets.

@dai1741
Created April 30, 2012 15:49
Show Gist options
  • Save dai1741/2559476 to your computer and use it in GitHub Desktop.
Save dai1741/2559476 to your computer and use it in GitHub Desktop.
flexとgccを使ってフォルダ内の*.lexを*.exeにコンパイルするMakefile
LEX = flex
CC = gcc
LDLIBS=-lfl
LEXES = $(wildcard *.lex)
EXES = $(LEXES:%.lex=%.exe)
all: $(EXES)
%.c:%.lex
$(LEX) -o $@ $^
%.exe:%.c
$(CC) -o $@ $^ $(LDLIBS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment