commit 6b9da17eb42e671946bf9326476a20f1b9497bdc Author: Roberto E. Vargas Caballero <k...@shike2.com> AuthorDate: Fri Jan 19 21:56:40 2024 +0100 Commit: Roberto E. Vargas Caballero <k...@shike2.com> CommitDate: Fri Jan 19 22:01:25 2024 +0100
build: Fix OBJ definition and remove MAN The MAN macro was not used, and it and OBJ had the same problem because they were defined using an empty string in the replace pattern of the macro expansion, but as it is said by POSIX: The subst1 to be replaced shall be recognized when it is a suffix at the end of a word in string1 so, an empty string should not be used. Also, a new inference rule is added to generate the binary directly from the .c without generating the intermediate object, removing the need of chaining different inference rules which is not guaranteed to work in all the make implementations. diff --git a/Makefile b/Makefile index 95bb21d..8cfd981 100644 --- a/Makefile +++ b/Makefile @@ -190,14 +190,13 @@ BIN =\ xinstall\ yes -OBJ = $(BIN:=.o) $(LIBUTFOBJ) $(LIBUTILOBJ) -MAN = $(BIN:=.1) +OBJ = $(LIBUTFOBJ) $(LIBUTILOBJ) all: $(BIN) $(BIN): $(LIB) -$(OBJ): $(HDR) +$(OBJ) $(BIN): $(HDR) .o: $(CC) $(LDFLAGS) -o $@ $< $(LIB) @@ -205,6 +204,9 @@ $(OBJ): $(HDR) .c.o: $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< +.c: + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(LIB) + libutf.a: $(LIBUTFOBJ) $(AR) $(ARFLAGS) $@ $? $(RANLIB) $@