Be more consistent with Makefile variables
This commit is contained in:
parent
61b122fcf5
commit
24253be975
8
Makefile
8
Makefile
@ -1,6 +1,6 @@
|
||||
OUTPUT ?= .
|
||||
LIBNAME ?= libmtar
|
||||
OBJDIR ?= obj
|
||||
OBJ ?= obj
|
||||
SRC := src
|
||||
|
||||
CC ?= gcc
|
||||
@ -9,14 +9,14 @@ CFLAGS ?= -O2 -Wall -Wextra
|
||||
CFLAGS := ${CFLAGS} -I.
|
||||
DESTDIR ?= /usr/local/lib
|
||||
|
||||
OBJS := $(OBJDIR)/tar.o
|
||||
OBJS := $(OBJ)/tar.o
|
||||
|
||||
build: $(OBJS)
|
||||
@echo -- Creating $(LIBNAME).a
|
||||
@mkdir -p $(OUTPUT)
|
||||
$(AR) rcs $(OUTPUT)/$(LIBNAME).a $(OBJS)
|
||||
|
||||
$(OBJDIR)/%.o: $(SRC)/%.c
|
||||
$(OBJ)/%.o: $(SRC)/%.c
|
||||
@echo -- Compiling $^
|
||||
@mkdir -p $(@D)
|
||||
$(CC) $(CFLAGS) -o $@ -c $^
|
||||
@ -27,7 +27,7 @@ install:
|
||||
cp $(OUTPUT)/$(LIBNAME).a $(DESTDIR)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJDIR)/*.o
|
||||
rm -f $(OBJ)/*.o
|
||||
rm -f $(OUTPUT)/$(LIBNAME).a
|
||||
|
||||
uninstall:
|
||||
|
Loading…
Reference in New Issue
Block a user