From 04ec088dfcbdf577987fe7ef93624d67e6d9c2e3 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Mon, 18 Jan 2021 21:41:08 -0500 Subject: Multiplatform builds! --- Makefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 39d2b10..6e2bece 100644 --- a/Makefile +++ b/Makefile @@ -11,24 +11,32 @@ STAT=pptdb BUILDROOT_DIR=buildroot-2020.11.1 -STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip -SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size -CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc +ifeq ($(PLATFORM), pi) + STRIP=$(BUILDROOT_DIR)/output/host/bin/arm-linux-strip + SIZE=$(BUILDROOT_DIR)/output/host/bin/arm-linux-size + CC=$(BUILDROOT_DIR)/output/host/bin/arm-linux-cc +else + SIZE=size + STRIP=strip +endif %.o: %.c $(CC) -c $< -o $@ $(CFLAGS) +all: $(PROG) $(STAT) + $(PROG): src/$(PROG).o $(OBJS) $(CC) $(CFLAGS) src/$(PROG).o $(OBJS) -o $(PROG) $(STRIP) $(PROG) $(SIZE) $(PROG) +ifeq ($(PLATFORM), pi) + $(info Building the pi image) + ./do_buildroot.sh $(BUILDROOT_DIR) +endif $(STAT): src/$(STAT).o $(OBJS) $(CC) $(CFLAGS) src/$(STAT).o $(OBJS) -o $(STAT) -buildroot: $(PROG) - ./do_buildroot.sh $(BUILDROOT_DIR) - clean: rm -f $(PROG) rm -f $(STAT) -- cgit v1.2.3