add makefile
This commit is contained in:
parent
8962f77af6
commit
340ca4337e
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,4 @@
|
||||||
config.json
|
config.json
|
||||||
|
lph
|
||||||
|
bot.log
|
||||||
|
obj/*
|
||||||
|
|
20
Makefile
Normal file
20
Makefile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
BIN = lph
|
||||||
|
CFILES = $(shell cd src && find -L * -type f -name '*.c')
|
||||||
|
OBJ = $(addprefix obj/,$(CFILES:.c=.o))
|
||||||
|
CC = gcc
|
||||||
|
CFLAGS = -O2
|
||||||
|
LDFLAGS = -ldiscord -lcurl
|
||||||
|
|
||||||
|
build: $(BIN)
|
||||||
|
run: build
|
||||||
|
./$(BIN)
|
||||||
|
|
||||||
|
$(BIN): $(OBJ)
|
||||||
|
$(CC) $(OBJ) -o $(BIN) $(LDFLAGS)
|
||||||
|
|
||||||
|
obj/%.o: src/%.c
|
||||||
|
mkdir -p obj
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(OBJ) $(BIN)
|
Loading…
Reference in a new issue