BASE := ..
-OBJECTS := $(patsubst %.c, %, $(wildcard *.c))
+OBJECTS := $(patsubst %.c, ../bin/%, $(wildcard *.c))
include $(BASE)/common.mk
CPPFLAGS += -I$(BASE) -I$(BASE)/AST -I$(BASE)/Collections
-all: $(OBJECTS)
+all: $(OBJECTS) ../bin/run.sh
-include $(DEPS)
-%: %.c
- $(CC) -MMD -MF $(@D)/.$(@F).d -o $@ $< $(CPPFLAGS) -L$(BASE)/bin/ -l_cons_comp
+../bin/%: %.c
+ $(CC) -MMD -MF $(@D)/.$(@F).d -o ../bin/$@ $< $(CPPFLAGS) -L$(BASE)/bin/ -l_cons_comp
+
+../bin/run.sh: run.sh
+ cp run.sh ../bin/run.sh
clean::
- rm -f $(OBJECTS) $(DEPS)
+ rm -f $(OBJECTS) $(DEPS) ../bin/run.sh