-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
64 lines (51 loc) · 2.33 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#***************************************************************************
# File makefile
# Date 23.07.17 - #1
# Copyright (c) 2017-2017 s710 (s710 (at) posteo (dot) de). All rights reserved.
# --------------------------------------------------------------------------
# Ark ClusterChat / makefile
#***************************************************************************
#--------------------------------------------------------------------------
# variables
#--------------------------------------------------------------------------
OBJDIR = obj
APPL = $(OBJDIR)/main.o $(OBJDIR)/channel.o $(OBJDIR)/thread.o $(OBJDIR)/rconthread.o $(OBJDIR)/clusterchat.o $(OBJDIR)/ini.o
DISTBIN = arkclusterchat
OPTS=-c -Wreturn-type -Wformat -pedantic -Wunused-variable -Wunused-label -Wunused-value -Wno-long-long -Wno-c++11-compat-deprecated-writable-strings -Wno-deprecated
CXXFLAGS ?= $(OPTS)
#--------------------------------------------------------------------------
# compiler
#--------------------------------------------------------------------------
CC = g++
doMake = make
doCompile = $(CC) $(CXXFLAGS)
doLink = $(CC)
doClean = rm *.o
#--------------------------------------------------------------------------
# Do
#--------------------------------------------------------------------------
all:
@(echo -; echo Making $(DISTBIN) ...; $(doMake) $(DISTBIN))
$(DISTBIN): $(APPL)
@echo Linking "$*" ...
$(doLink) $(APPL) -o $@ -lpthread
clean:
@(echo Cleanup of app/$(DISTBIN) ... )
(rm $(DISTBIN))
(cd $(OBJDIR) && $(doClean))
#--------------------------------------------------------------------------
# Compiler Call
#--------------------------------------------------------------------------
$(OBJDIR)/%.o: %.c*
@echo Compile "$(*F)" ...
@mkdir -p $(@D)
$(doCompile) $(*F).c* -o $@
#--------------------------------------------------------------------------
# module dependencies
#--------------------------------------------------------------------------
$(OBJDIR)/main.o : main.cc
$(OBJDIR)/channel.o : channel.cc channel.hpp
$(OBJDIR)/thread.o : thread.cc thread.hpp def.h
$(OBJDIR)/rconthread.o : rconthread.cc rconthread.hpp thread.hpp def.h
$(OBJDIR)/clusterchat.o : clusterchat.cc clusterchat.hpp rconthread.hpp def.h
$(OBJDIR)/ini.o : ini.c ini.h