Ex2 extra credit

Ok… I feel really silly I had such a hard time with making this work! But I got it to work, so just typing ‘make’ will make all files. Had to rearrange and figure out a lot of stuff from stuff on stackoverflow that wouldn’t work for me. Did I just go overboard? Was there a much simpler way to make all the files at once?

SRCS = $(wildcard *.c)

.PHONEY = $(patsubst %.c,%,$(SRCS))

all: $(.PHONEY)

	rm -f $(.PHONEY)
%: %.c
		$(CC) $< -o $@

I figured out I read it wrong… sorry. You wanted a makefile that had all: with target ex1… for craps sakes.

Great, glad you figured it out. There’s a few other ways to do it, but if this works go with it.