summaryrefslogtreecommitdiff
path: root/Makefile
blob: a91b0842c58323f0e2b7ea6c7557fa5e054b9c40 (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
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
MKDIR=mkdir
CP=cp
CC=gcc

BUILDDIR=build



# Object Files
OBJECTFILES= \
        ${BUILDDIR}/db.o \
        ${BUILDDIR}/ini.o \
        ${BUILDDIR}/logger.o \
        ${BUILDDIR}/main.o \
        ${BUILDDIR}/server.o


# C Compiler Flags
CFLAGS=


# Link Libraries and Options
LDLIBSOPTIONS=-lpq

# Build Targets

qotdserver: ${OBJECTFILES}
	${LINK.c} -o ${BUILDDIR}/qotdserver ${OBJECTFILES} ${LDLIBSOPTIONS}

${BUILDDIR}/db.o: db.c
	${MKDIR} -p ${BUILDDIR}
	${RM} "$@.d"
	$(COMPILE.c) -g -I/usr/include/postgresql/ -MMD -MP -MF "$@.d" -o ${BUILDDIR}/db.o db.c

${BUILDDIR}/ini.o: ini.c
	${MKDIR} -p ${BUILDDIR}
	${RM} "$@.d"
	$(COMPILE.c) -g -MMD -MP -MF "$@.d" -o ${BUILDDIR}/ini.o ini.c

${BUILDDIR}/logger.o: logger.c
	${MKDIR} -p ${BUILDDIR}
	${RM} "$@.d"
	$(COMPILE.c) -g -MMD -MP -MF "$@.d" -o ${BUILDDIR}/logger.o logger.c

${BUILDDIR}/main.o: main.c
	${MKDIR} -p ${BUILDDIR}
	${RM} "$@.d"
	$(COMPILE.c) -g -MMD -MP -MF "$@.d" -o ${BUILDDIR}/main.o main.c

${BUILDDIR}/server.o: server.c
	${MKDIR} -p ${BUILDDIR}
	${RM} "$@.d"
	$(COMPILE.c) -g -MMD -MP -MF "$@.d" -o ${BUILDDIR}/server.o server.c


clean: 
	${RM} -r ${BUILDDIR}
	

install:
	${CP} ${BUILDDIR}/qotdserver /usr/sbin/
	${CP} qotdserver.conf /etc/