Skip to content

Commit

Permalink
Makefile: Make it more flexible...
Browse files Browse the repository at this point in the history
* Add possibility to override compiler and CFLAGS
* Add possibility to use custom LDFLAGS for linking
* Add install target
  • Loading branch information
Polynomial-C committed Jan 19, 2025
1 parent 4864354 commit ff222c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
TARGETS = xl710_unlock

CC ?= gcc
CFLAGS ?= -Wall -O2

INST_DIR ?= /usr/sbin


all: $(TARGETS)

clean:
rm -f $(TARGETS)

%: %.c
gcc -Wall -O2 $< -o $@
$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@

install:
mkdir -p $(DESTDIR)/$(INST_DIR)
install -m 750 $(TARGETS) $(DESTDIR)/$(INST_DIR)

0 comments on commit ff222c1

Please sign in to comment.