From 931708ce1f8b46a84cfe0db9917d0c0381600e00 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Wed, 11 Jan 2017 20:50:22 +0100 Subject: [PATCH] makefile --- int/Makefile | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) mode change 100644 => 100755 int/Makefile diff --git a/int/Makefile b/int/Makefile old mode 100644 new mode 100755 index b311ea5..23ecaf7 --- a/int/Makefile +++ b/int/Makefile @@ -1,18 +1,34 @@ -CPPFLAGS:=-g -Wall -Wextra -Werror -DDEBUG -PROG:=main -OBJS:=interpret.o sds.o task.o main.o - -all: mTaskSymbols.h $(PROG) - -%.o: %.cpp - g++ $(CPPFLAGS) -c $< -o $@ - -$(PROG): $(OBJS) misc.h - g++ $(LDFLAGS) -o $@ $(OBJS) - -mTaskSymbols.h: - CLMFLAGS=-nr make -BC .. mTaskInterpret - ../mTaskInterpret > $@ - -clean: - $(RM) $(OBJS) $(PROG) +export +SHOWPJ = 1 +AUTOJ = 1 +MAKES = $(wildcard */Makefile) +DIRS = $(patsubst %/Makefile,%,$(MAKES)) +CLNS = $(patsubst %,%/cln,$(DIRS)) +BINS = $(foreach a,$(DIRS),$(a)/$(a).bin) + +all: $(BINS) +# -test -d com/tools && make -C com/tools all +# @echo made $(BINS) + +hb: $(filter homebus-%,$(BINS)) + +tools: + -test -d com/tools && make -C com/tools all + +info: + $(info $(BINS)) + $(info $(CLNS)) + $(info $(dir $(BINS))) + +$(BINS): + @${MAKE} -C $(dir $@) + +clean: $(CLNS) + -test -d com/tools && make -C com/tools clean +# -test -d com/homebus-bpi && make -C homebus-bpi clean + find . -name *.d -o -name *.o -o -name *.a -o -name *.bin -o -name *.out -o -name *.list -o -name *.map -o -name *.hex -o -name *.s19 -o -name *.sl |xargs rm -fv + -rm -rfv */o/* */filelist + +$(CLNS): + @${MAKE} -C $(dir $@) clean + @touch $@ -- 2.20.1