Be more consistent with Makefile variables

This commit is contained in:
apio 2022-11-05 18:53:55 +01:00
parent 61b122fcf5
commit 24253be975

View File

@ -1,6 +1,6 @@
OUTPUT ?= . OUTPUT ?= .
LIBNAME ?= libmtar LIBNAME ?= libmtar
OBJDIR ?= obj OBJ ?= obj
SRC := src SRC := src
CC ?= gcc CC ?= gcc
@ -9,14 +9,14 @@ CFLAGS ?= -O2 -Wall -Wextra
CFLAGS := ${CFLAGS} -I. CFLAGS := ${CFLAGS} -I.
DESTDIR ?= /usr/local/lib DESTDIR ?= /usr/local/lib
OBJS := $(OBJDIR)/tar.o OBJS := $(OBJ)/tar.o
build: $(OBJS) build: $(OBJS)
@echo -- Creating $(LIBNAME).a @echo -- Creating $(LIBNAME).a
@mkdir -p $(OUTPUT) @mkdir -p $(OUTPUT)
$(AR) rcs $(OUTPUT)/$(LIBNAME).a $(OBJS) $(AR) rcs $(OUTPUT)/$(LIBNAME).a $(OBJS)
$(OBJDIR)/%.o: $(SRC)/%.c $(OBJ)/%.o: $(SRC)/%.c
@echo -- Compiling $^ @echo -- Compiling $^
@mkdir -p $(@D) @mkdir -p $(@D)
$(CC) $(CFLAGS) -o $@ -c $^ $(CC) $(CFLAGS) -o $@ -c $^
@ -27,7 +27,7 @@ install:
cp $(OUTPUT)/$(LIBNAME).a $(DESTDIR) cp $(OUTPUT)/$(LIBNAME).a $(DESTDIR)
clean: clean:
rm -f $(OBJDIR)/*.o rm -f $(OBJ)/*.o
rm -f $(OUTPUT)/$(LIBNAME).a rm -f $(OUTPUT)/$(LIBNAME).a
uninstall: uninstall: