CC = h8300-elf-gcc NEWLIB_DIR = /usr/local/h8300-elf/lib/h8300h CFLAGS ?= \ -I../.. -I. -I/usr/local/h8300-elf/include \ -Wall -mh -g -mint32 -mrelax -gdwarf-2 -O2 BUILD_DIR ?= build_by_gcc SRCS_C = \ $(shell ls *.c) OBJS = $(SRCS_C:.c=.o) all : $(BUILD_DIR) $(patsubst %,$(BUILD_DIR)/%,$(OBJS)) $(BUILD_DIR)/%.o : %.c $(CC) -c $(CFLAGS) -o $@ $< $(BUILD_DIR) : mkdir $@ clean : cd $(BUILD_DIR); rm -f $(OBJS) run : all .PHONY : clean all