This is an incredibly simple question, but I\'m new to makefiles. I am trying to make a makefile that will compile two independent programs:
program1:
gc
This will compile all *.c files upon make to executables without the .c extension as in gcc program.c -o program.
make will automatically add any flags you add to CFLAGS like CFLAGS = -g Wall.
If you don't need any flags CFLAGS can be left blank (as below) or omitted completely.
SOURCES = $(wildcard *.c)
EXECS = $(SOURCES:%.c=%)
CFLAGS =
all: $(EXECS)