Skip to content

Commit

Permalink
make: make CC and friends optional
Browse files Browse the repository at this point in the history
This makes the Makefile more compiler independent and increases the
flexibility of the makefile.

Signed-off-by: Silvio Fricke <[email protected]>
  • Loading branch information
silvio committed Jul 15, 2020
1 parent 59e9e40 commit 09dcf2c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC=gcc
CFLAGS=-fPIC
CFLAGS_SHARED=-shared
CC?=gcc
CFLAGS?=-fPIC
CFLAGS_SHARED?=-shared
OBJ=mma8451.o
LIBNAME=libmma8451.so
TESTOBJ=mma8451-test.o
Expand All @@ -24,7 +24,7 @@ clean:
$(CC) -c -o $@ $< $(CFLAGS)

$(LIBNAME): $(OBJ)
gcc -o $@ $^ $(CFLAGS) $(CFLAGS_SHARED)
$(CC) -o $@ $^ $(CFLAGS) $(CFLAGS_SHARED)

$(TESTNAME): $(LIBNAME) $(TESTOBJ)
gcc -o $@ $^ $(CFLAGS) -L. -lmma8451
$(CC) -o $@ $^ $(CFLAGS) -L. -lmma8451

0 comments on commit 09dcf2c

Please sign in to comment.