Makefile
1.12 KB
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
PROJECT = xmlrpc
INCLUDE = include
CFLAGS = -Wall -ggdb
###
# PROJECT CONFIG
#
SUBDIRS = system server reader
system_OBJ = daemonize.o handleCmdLine.o logRotate.o monitor.o \
signalHandling.o socket.o
server_OBJ = serverInit.o serverRun.o serverShutdown.o
commonReader_OBJ = clientClose.o clientRead.o writeBuffer.o
httpReader_OBJ = httpRequest.o
VPATH=$(INCLUDE)
export CFLAGS INCLUDE \
system_OBJ server_OBJ commonReader_OBJ httpReader_OBJ
OBJECTS=$(PROJECT).o \
$(addprefix system/,$(system_OBJ)) \
$(addprefix server/,$(server_OBJ)) \
$(addprefix reader/commonReader/,$(commonReader_OBJ)) \
$(addprefix reader/httpReader/,$(httpReader_OBJ))
###
# EXPLICIT RULES
#
$(PROJECT): $(PROJECT).o subdirs
gcc $(CFLAGS) -o $(PROJECT) -lexpat $(OBJECTS)
$(PROJECT).o: server.h monitor.h signalHandling.h daemonize.h appConfig.h
###
# IMPLICIT RULES
#
%.o: %.c
gcc $(CFLAGS) -c $< -o $@
###
# PHONYS
#
.PHONY: clean subdirs subdirs_clean $(SUBDIRS)
subdirs: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@
subdirs_clean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir clean; \
done
clean: subdirs_clean
-rm *.o