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.
This commit is contained in:
Roberto E. Vargas Caballero 2024-01-19 21:56:40 +01:00
parent 270ca025ce
commit 6b9da17eb4
1 changed files with 5 additions and 3 deletions

View File

@ -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) $@