CFLAGS := -Iinc -g -Og -Wall #-DDEBUG # 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: run run: lib/interpret ./lib/interpret .PHONY: clean clean: rm -r obj lib