git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Simplify building of programs

From
Jonas Fonseca <fonseca@diku.dk>
Date
Apr 23, 2005, 23:59 UTC
Message-ID
<20050423235956.GA7437@diku.dk>

Don't list libgit.a twice when compiling programs and make them depend on the .c files so .o files are not left behind.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>

--- 66b3fa5bde838935121a2eb7cf4b67587c32de13/Makefile (mode:100644 sha1:e26b7c3695bf7ee88a75dcb6fd1953ce8b33c748) +++ uncommitted/Makefile (mode:100644)

@@ -49,8 +49,7 @@
 LIB_H=cache.h object.h
 
 
-LIBS = $(LIB_FILE)
-LIBS += -lz
+LIBS = -lz
 
 ifdef MOZILLA_SHA1
 	SHA1_HEADER="mozilla-sha1/sha1.h"
@@ -70,7 +69,7 @@
 
 all: $(PROG) $(GEN_SCRIPT)
 
-$(PROG):%: %.o $(LIB_FILE)
+$(PROG):%: %.c $(LIB_FILE)
 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
 
 $(LIB_FILE): $(LIB_OBJS)
-- 
Jonas Fonseca
Next: Jonas Fonseca
Message 1 of 2 in “Simplify building of programs”
  1. Simplify building of programsJonas Fonseca, Apr 23, 2005
  2. Jonas FonsecaApr 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.