-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 764 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 764 Bytes
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
29
30
31
32
33
34
35
36
37
38
CC = gcc
CFLAGS = -Wall -Wextra -std=gnu99 $(shell pkg-config --cflags toxcore) #TODO: switch to c99
LDFLAGS = $(shell pkg-config --libs toxcore)
SRC = $(wildcard src/*.c ) $(wildcard src/*/*.c) third-party/minini/dev/minIni.c
OBJ = $(SRC:.c=.o)
HEADERS = $(wildcard src/*.h) $(wildcard src/*/*.h)
DEBUG = 1
PREFIX = /usr/local
EXECUTABLE = toxirc
ifeq ($(DEBUG), 1)
CFLAGS += -g
endif
all: $(SRC) $(EXECUTABLE)
$(EXECUTABLE): $(OBJ) $(HEADERS)
$(CC) $(OBJ) $(LDFLAGS) -o $(EXECUTABLE)
.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm src/*.o src/*/*.o $(EXECUTABLE)
rebuild: clean all
install: all
@echo "Installing binary..."
install -m 0755 $(EXECUTABLE) $(PREFIX)/bin/$(EXECUTABLE)
deps:
@git submodule init
@git submodule update
.PHONY: all clean