1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
CFLAGS := -Iinc -g -Og -Wall # Lähtekood SRC := $(wildcard src/*.c) OBJ := $(patsubst src/%.c, obj/%.o, $(SRC)) all: lib/interpret lib/interpret: $(OBJ) | lib gcc $(CFLAGS) $(OBJ) -o lib/interpret obj/%.o: src/%.c | obj gcc -c $(CFLAGS) -o $@ $< # Dirs lib: mkdir lib obj: mkdir obj .PHONY: clean clean: rm -r obj lib