Is there a way using GNU Make of compiling all of the C files in a directory into separate programs, with each program named as the source file without the .c extension?
SRCS = $(wildcard *.c) PROGS = $(patsubst %.c,%,$(SRCS)) all: $(PROGS) %: %.c $(CC) $(CFLAGS) -o $@ $<
1.4m articles
1.4m replys
5 comments
57.0k users