Skip to content

Commit

Permalink
Make makefile more packaging friendly
Browse files Browse the repository at this point in the history
- Respect CC/CFLAGS/LDFLAGS set in the environment (by user or by build system)
- Use CC as a linker, avoid unneeded static linking
  • Loading branch information
AMDmi3 committed Nov 28, 2019
1 parent fa4baf0 commit 9647f0d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/makefiles/Makefile.linux
@@ -1,7 +1,7 @@
CC = gcc
LD = gcc -static
CFLAGS = -Wall -O3 $(CDEFS)
LDFLAGS = -s
CC ?= gcc
CFLAGS ?= -Wall -O3
CFLAGS += $(CDEFS)
LDFLAGS ?= -s

SOURCES = avra.c \
device.c \
Expand All @@ -19,7 +19,7 @@ SOURCES = avra.c \
OBJECTS = $(SOURCES:.c=.o)

avra: $(OBJECTS)
$(LD) -o $@ $(OBJECTS) $(LDFLAGS)
$(CC) -o $@ $(OBJECTS) $(LDFLAGS)

clean:
rm -f avra *.o *.p *~
Expand Down

0 comments on commit 9647f0d

Please sign in to comment.