aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 14 insertions, 6 deletions
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)