-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (71 loc) · 2.43 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#
# @file Makefile @brief core runtime configuration Makefile.
#
# Copyright (c) 2010, 2021 by Lutz Sammer. All Rights Reserved.
#
# Contributor(s):
#
# License: AGPLv3
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# $Id$
#----------------------------------------------------------------------------
VERSION := "1.12"
GIT_REV := $(shell git describe --always 2>/dev/null)
CC := gcc
OPTIM := -march=native -O2 -fomit-frame-pointer
CFLAGS = $(OPTIM) -g -pipe -W -Wall -Wextra -Winit-self \
-Wdeclaration-after-statement -DCORE_RC_TEST -DDEBUG_CORE_RC \
-DVERSION='$(VERSION)' $(if $(GIT_REV), -DGIT_REV='"$(GIT_REV)"')
#STATIC= --static
LIBS = $(STATIC)
HDRS := core-rc.h
OBJS := core-rc.o
FILES := Makefile README.txt Changelog LICENSE.md AGPL-v3.0.md \
core-rc.doxyfile
all: rc_test
#----------------------------------------------------------------------------
# Modules
core-array/core-array.mk:
git submodule init core-array
git submodule update core-array
include core-array/core-array.mk
#----------------------------------------------------------------------------
rc_test : $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
$(OBJS) : Makefile
core-rc_parser.c: core-rc_parser.peg core-rc_parser.c.in
peg -o core-rc_parser.c core-rc_parser.peg \
|| cp core-rc_parser.c.in core-rc_parser.c
core-rc.o: core-rc_parser.c
#----------------------------------------------------------------------------
# Developer tools
doc: $(SRCS) $(HDRS) core-rc.doxyfile
(cat core-rc.doxyfile; \
echo 'PROJECT_NUMBER=${VERSION} $(if $(GIT_REV), (GIT-$(GIT_REV)))') \
| doxygen -
indent:
for i in $(OBJS:.o=.c) $(HDRS); do \
indent $$i; unexpand -a $$i > $$i.up; mv $$i.up $$i; \
done
clean:
-rm *.o *~
clobber: clean
-rm -rf rc_test core-rc_parser.c www/html
dist:
tar cjCf .. core-rc-`date +%F-%H`.tar.bz2 \
$(addprefix core-rc/, $(FILES) $(HDRS) $(OBJS:.o=.c))
install:
##strip --strip-unneeded -R .comment binary_file
#install -s binary_file /usr/local/bin/
help:
@echo "make all|doc|indent|clean|clobber|dist|install|help"