-DIRS=clock mem ppu dev cpu
+DIRS=clock mem ppu apu cpu
MODULES=address_decoder.vhd motones_sim.vhd
WORKDIR=work
TEST_MODULE = testbench_motones_sim.vhd
clean:
-rm $(OBJS)
-rm $(BIN)
- -rm $(patsubst $(WORKDIR)/,$(WORKDIR)/e~, $(OBJS))
- -rm *.o *.cf *.vcd
+ -rm $(subst .vhd,,$(WORKDIR)/e~$(TEST_MODULE)).o
+ -rm testbench.vcd*
rclean: clean
+ for dir in $(DIRS); do \
+ make -C $(ROOT_DIR)/$$dir clean; \
+ done
-rm $(WORKDIR)/*
OBJS = $(addprefix $(WORKDIR)/,$(addsuffix .o,$(basename $(MODULES) $(TEST_MODULE))))
-all: $(BIN)
+all: $(OBJS)
+test: $(BIN)
$(WORKDIR)/%.o: %.vhd
ghdl -a $(GHDL_OPTION) $(subst .o,.vhd, $(subst $(WORKDIR)/,, $@))
clean:
-rm $(OBJS)
-rm $(BIN)
- -rm $(patsubst $(WORKDIR)/,$(WORKDIR)/e~, $(OBJS))
- -rm *.o *.cf testbench.vcd*
+ -rm $(subst .vhd,,$(WORKDIR)/e~$(TEST_MODULE)).o
+ -rm testbench.vcd*
OBJS = $(addprefix $(WORKDIR)/,$(addsuffix .o,$(basename $(MODULES) $(TEST_MODULE))))
-all: $(BIN)
+all: $(OBJS)
+
+test: $(BIN)
$(WORKDIR)/%.o: %.vhd
ghdl -a $(GHDL_OPTION) $(subst .o,.vhd, $(subst $(WORKDIR)/,, $@))
clean:
-rm $(OBJS)
-rm $(BIN)
- -rm $(patsubst $(WORKDIR)/,$(WORKDIR)/e~, $(OBJS))
- -rm *.o *.cf *.vcd
+ -rm $(subst .vhd,,$(WORKDIR)/e~$(TEST_MODULE)).o
+ -rm testbench.vcd*
OBJS = $(addprefix $(WORKDIR)/,$(addsuffix .o,$(basename $(MODULES) $(TEST_MODULE))))
-all: $(BIN)
+all: $(OBJS)
+test: $(BIN)
$(WORKDIR)/%.o: %.vhd
ghdl -a $(GHDL_OPTION) $(subst .o,.vhd, $(subst $(WORKDIR)/,, $@))
clean:
-rm $(OBJS)
-rm $(BIN)
- -rm $(patsubst $(WORKDIR)/,$(WORKDIR)/e~, $(OBJS))
- -rm *.o *.cf *.vcd
+ -rm $(subst .vhd,,$(WORKDIR)/e~$(TEST_MODULE)).o
+ -rm testbench.vcd*
OBJS = $(addprefix $(WORKDIR)/,$(addsuffix .o,$(basename $(MODULES) $(TEST_MODULE))))
-all: $(BIN)
+all: $(OBJS)
+
+test: $(BIN)
$(WORKDIR)/%.o: %.vhd
ghdl -a $(GHDL_OPTION) $(subst .o,.vhd, $(subst $(WORKDIR)/,, $@))
clean:
-rm $(OBJS)
-rm $(BIN)
- -rm $(patsubst $(WORKDIR)/,$(WORKDIR)/e~, $(OBJS))
- -rm *.o *.cf testbench.vcd*
+ -rm $(subst .vhd,,$(WORKDIR)/e~$(TEST_MODULE)).o
+ -rm testbench.vcd*