Skip to content

Commit 9647f0d

Browse files
authored
Make makefile more packaging friendly
- Respect CC/CFLAGS/LDFLAGS set in the environment (by user or by build system) - Use CC as a linker, avoid unneeded static linking
1 parent fa4baf0 commit 9647f0d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/makefiles/Makefile.linux‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
CC = gcc
2-
LD = gcc -static
3-
CFLAGS = -Wall -O3 $(CDEFS)
4-
LDFLAGS = -s
1+
CC ?= gcc
2+
CFLAGS ?= -Wall -O3
3+
CFLAGS += $(CDEFS)
4+
LDFLAGS ?= -s
55

66
SOURCES = avra.c \
77
device.c \
@@ -19,7 +19,7 @@ SOURCES = avra.c \
1919
OBJECTS = $(SOURCES:.c=.o)
2020

2121
avra: $(OBJECTS)
22-
$(LD) -o $@ $(OBJECTS) $(LDFLAGS)
22+
$(CC) -o $@ $(OBJECTS) $(LDFLAGS)
2323

2424
clean:
2525
rm -f avra *.o *.p *~

0 commit comments

Comments
 (0)