From 373d723d479a2644f680fee1d0f416f9fddfb503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= Date: Sat, 27 Sep 2025 16:52:50 +0200 Subject: [PATCH] build: tools: also declutter sourcecode --- Makefile | 6 +++--- tools/Makefile | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 107c41a..cdfb02d 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ OBJS = ${SRCS:%.c=$(BUILDDIR)%.rel} OBJS += uip/$(BUILDDIR)/timer.rel uip/$(BUILDDIR)/uip-fw.rel uip/$(BUILDDIR)/uip-neighbor.rel uip/$(BUILDDIR)/uip-split.rel uip/$(BUILDDIR)/uip.rel uip/$(BUILDDIR)/uip_arp.rel uip/$(BUILDDIR)/uiplib.rel httpd/$(BUILDDIR)/httpd.rel httpd/$(BUILDDIR)/page_impl.rel html_data.c html_data.h: html tools - tools/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -b BANK1 -d html -p html_data + tools/$(BUILDDIR)fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -b BANK1 -d html -p html_data httpd: html_data.h @@ -59,8 +59,8 @@ $(BUILDDIR)rtlplayground.bin: $(BUILDDIR)rtlplayground.img cat $< >> $@ truncate --size=16K $@ dd if=$< skip=80 bs=1024 >>$@ - tools/fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ - tools/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -d html -p html_data $@ + tools/$(BUILDDIR)fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ + tools/$(BUILDDIR)fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -d html -p html_data $@ .PHONY: clean all $(SUBDIRS) \ No newline at end of file diff --git a/tools/Makefile b/tools/Makefile index ee596db..87333ed 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,16 +1,20 @@ CC = gcc CCFLAGS = -Wall -o +BUILDDIR = output/ -all: injector fileadder httpd_sim +all: create_build_dir $(BUILDDIR)injector $(BUILDDIR)fileadder $(BUILDDIR)httpd_sim + +create_build_dir: + mkdir -p $(BUILDDIR) clean: - rm *.o + rm -r $(BUILDDIR) -injector: injector.c +$(BUILDDIR)injector: injector.c gcc $^ $(CCFLAGS) $@ -fileadder: fileadder.c +$(BUILDDIR)fileadder: fileadder.c gcc $^ $(CCFLAGS) $@ -httpd_sim: httpd_sim.c httpd_sim.h +$(BUILDDIR)httpd_sim: httpd_sim.c httpd_sim.h gcc $< $(CCFLAGS) $@ -I/usr/include/json-c -ljson-c