aboutsummaryrefslogtreecommitdiff
path: root/client/makefile
blob: d89c186c3643a2fffbb36ed0d7122e3833eb47fe (plain)
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
CC = gcc
LD = gcc
RM = rm -f
CFLAGS = -DW2_LANG_NL_NL
LDFLAGS = -lncursesw
EXECNAME = main

include ../shared/os.mk

all: $(EXECNAME)

SOURCES := $(wildcard *.c)
HEADERS := $(wildcard *.h)
include ../shared/makefile

CFLAGS += $(if $(WIN32),-I/mingw64/include/ncursesw,)

OBJECTS := $(patsubst %.c,%.o, $(SOURCES))

.o:
	$(CC) -c $(CFLAGS) $<

$(EXECNAME): $(OBJECTS)
	$(CC) $(OBJECTS) -o $(EXECNAME) $(LDFLAGS)

clean::
	$(RM) $(EXECNAME) *.o

format:
	clang-format -i $(SOURCES) $(HEADERS)
	clang-tidy --fix-errors $(SOURCES) $(HEADERS)

compile_commands: clean
	compiledb make