Regex to select all .c files except ones with a certain prefix


I have what should be a real simple regex question. I'm making a makefile and need one target to compile all the source in my directory except one or two files that have a named prefix of ttem_endian_port. What regex can I use to make this as simple as possible?

I was thinking something like [^ttem_endian_port*]*.c but that doesn't seem to work.

Best Solution

Do you really need a regex? make's built-in functions can do this as well.

ALL_SRCS := $(wildcard *.c)
SRCS     := $(filter-out ttem_endian_port%.c, $(ALL_SRCS))