[Cryptech-Commits] [sw/stm32] 01/02: Rename main.c to hsm.c for consistency and a slightly simpler Makefile.

git at cryptech.is git at cryptech.is
Fri Jun 10 02:27:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

commit 5a0c56d9b4d7076ddf8ed762c22519290de3f998
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Thu Jun 9 11:47:00 2016 -0400

    Rename main.c to hsm.c for consistency and a slightly simpler Makefile.
---
 projects/hsm/Makefile          | 13 ++++++-------
 projects/hsm/{main.c => hsm.c} |  0
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/projects/hsm/Makefile b/projects/hsm/Makefile
index f5546d8..d8fd1f9 100644
--- a/projects/hsm/Makefile
+++ b/projects/hsm/Makefile
@@ -1,8 +1,7 @@
 PROJ = hsm
 
-SRCS = main.c
-
-OBJS = $(SRCS:.c=.o)
+# objs in addition to $(PROJ).o
+OBJS = 
 
 CFLAGS += -I $(LIBHAL_DIR)
 
@@ -10,10 +9,10 @@ LIBS += $(LIBHAL_DIR)/libhal.a $(LIBTFM_DIR)/libtfm.a
 
 all: $(PROJ:=.elf)
 
-$(PROJ).elf: $(OBJS) $(BOARD_OBJS) $(LIBS)
-	$(CC) $(CFLAGS) $^ -o $@ -T$(LDSCRIPT) -g -Wl,-Map=$(PROJ).map
-	$(OBJCOPY) -O binary $(PROJ).elf $(PROJ).bin
-	$(SIZE) $(PROJ).elf
+%.elf: %.o $(BOARD_OBJS) $(OBJS) $(LIBS)
+	$(CC) $(CFLAGS) $^ -o $@ -T$(LDSCRIPT) -g -Wl,-Map=$*.map
+	$(OBJCOPY) -O binary $*.elf $*.bin
+	$(SIZE) $*.elf
 
 clean:
 	rm -f *.o
diff --git a/projects/hsm/main.c b/projects/hsm/hsm.c
similarity index 100%
rename from projects/hsm/main.c
rename to projects/hsm/hsm.c



More information about the Commits mailing list