Skip to content

Commit

Permalink
leverage $(AR) and allow mkdir-invocation to be configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
HalosGhost committed May 24, 2019
1 parent a17815f commit 41f3a6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PROJ = mpc
CC ?= gcc
STND = -ansi
DIST = build
MKDIR ?= mkdir -p
PREFIX ?= /usr/local
CFLAGS ?= $(STND) -pedantic -O3 -g -Wall -Werror -Wextra -Wformat=2 -Wshadow \
-Wno-long-long -Wno-overlength-strings -Wno-format-nonliteral -Wcast-align \
Expand All @@ -17,7 +18,7 @@ EXAMPLESEXE = $(EXAMPLES:.c=)
all: $(EXAMPLESEXE) check

$(DIST):
mkdir -p $(DIST)/examples
$(MKDIR) $(DIST)/examples

check: test-file test-static test-dynamic
./$(DIST)/test-file
Expand All @@ -41,7 +42,7 @@ lib$(PROJ).so: $(DIST) $(PROJ).c

lib$(PROJ).a: $(DIST) $(PROJ).c
$(CC) $(CFLAGS) -c $(PROJ).c -o $(DIST)/$(PROJ).o
ar rcs $(DIST)/lib$(PROJ).a $(DIST)/$(PROJ).o
$(AR) rcs $(DIST)/lib$(PROJ).a $(DIST)/$(PROJ).o

libs: lib$(PROJ).so lib$(PROJ).a

Expand Down

0 comments on commit 41f3a6d

Please sign in to comment.