~roshless/fup

ref: 176a33b645de9c356e14b0a5f3c2549f8505feb3 fup/Makefile -rw-r--r-- 555 bytes
176a33b6Roshless small pkg fixes and artifact 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
BINARY = fup
LIBS = -lcurl
CFLAGS = -g -Wall -Wextra -Werror -Wno-unused-parameter
INCLUDE += -Iinclude
BUILDDIR = .build

BINDIR += $(DESTDIR)$(PREFIX)/bin

.PHONY: default all clean install

default: all
all: $(BINARY)

OBJECTS = $(patsubst src/%.c, $(BUILDDIR)/%.o, $(wildcard src/*.c))

$(BUILDDIR)/%.o: src/%.c
	@mkdir -p $(BUILDDIR)
	$(CC) -c -o $@ $(CFLAGS) $(INCLUDE) $<

$(BINARY): $(OBJECTS)
	$(CC) $^ -Wall $(LIBS) -o $@

install: $(TARGET)
	mkdir -p $(BINDIR)
	install -m755 $(BINARY) $(BINDIR)/$(BINARY)

clean:
	rm -rf $(BUILDDIR) $(BINARY)