-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (34 loc) · 972 Bytes
/
Makefile
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
39
40
41
42
CC = gcc
DBGFLAGS = -ggdb
CFLAGS = -std=gnu99 -fplan9-extensions $(DBGFLAGS) -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable
LDFLAGS =
LIBS =
INCLUDE =
TARGET = playersvc
OBJDIR = ./obj
ifeq "$(strip $(OBJDIR))" ""
OBJDIR = .
endif
SOURCES = playersvc.c
LIBS = -lpthread -lreadline -lcrypt
OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o))
HEADERS = $(SOURCES:.c=.h) specific-commands.h
INCLUDE += -I./
$(TARGET): $(OBJECTS)
$(CC) $(LIBS) -o $@ $^ $(LDFLAGS)
$(OBJDIR)/%.o: %.c $(HEADERS)
@[ -d $$(dirname $@) ] || mkdir -p $$(dirname $@)
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
all: clean $(TARGET)
clean:
-rm -f $(OBJECTS) $(TARGET)
-@rmdir --ignore-fail-on-non-empty $$(readlink -f $(OBJDIR))
.PHONY: copy
copy:
for f in $(SOURCES) $(HEADERS); do scp $${f} [email protected]:Entwicklung/PlayerSvc/; done
.PHONY: run
run:
./$(TARGET)
.PHONY: doc
doc:
doxygen doxygen.conf