# Add your c files (incl dir) to the variable below
C_FILES=WHEEL_READ/wheel_read.c ENGINE_READ/engine_read.c

# Add your header files (incl dir) to the variable below
H_FILES=WHEEL_READ/wheel.h ENGINE_READ/engine.h

MAIN_C=main.c


#
# You should not need to fiddle with the below
#
# .. but try it out :)
#

#
# Name of our program
#
PROGRAM=vecu

#
# variable with the object file names
#   created from the C_FILES variable
#   by simply replacing the .c with .o
#
OBJS=$(C_FILES:.c=.o)
AUTOSAVES=$(C_FILES:.c=.c~) $(H_FILES:.h=.h~) $(MAIN_C:.c=.c~)

CFLAGS=-Wall -pedantic -Werror

all: $(PROGRAM)

check:
	@echo "OBJS:    $(OBJS)"
	@echo "C_FILES: $(C_FILES)"
	@echo "H_FILES: $(H_FILES)"

$(OBJS): $(H_FILES) Makefile

%.c:Makefile $(C_FILES)

%.o::%.c
	gcc $(CFLAGS)  -c $< -o $@

%.E::%.c
	gcc -E $< -o $@

check: all

clean:
	-rm -f $(OBJS) vecu a.out *~ *.o
	-rm -f $(AUTOSAVES)

$(PROGRAM): $(OBJS) $(MAIN_C)
	gcc $(CFLAGS) $(MAIN_C) $(OBJS) -o $@


indent:
	indent -gnu $(C_FILES) $(MAIN_C) $(H_FILES)


run:
	./$(PROGRAM)







