-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (64 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
# FOSSology Makefile - agent/nomossa
# This is to make a version of nomos that does not require any of the fossology build dependencies.
# Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
TOP = .
VARS = $(TOP)/Makefile.conf
include $(VARS)
EXE = nomos
PREFIX = /usr
SPEC = STRINGS.in
CHECK = CHECKSTR
PRE = PRECHECK
PDATA =_split_words
LICFIX = GENSEARCHDATA
OBJS = standalone.o licenses.o list.o parse.o process.o nomos_regex.o util.o nomos_gap.o nomos_utils.o doctorBuffer_utils.o json_writer.o # sources.o DMalloc.o
GENOBJS = _precheck.o _autodata.o
HDRS = nomos.h $(OBJS:.o=.h) _autodefs.h
#CFLAGS_LOCAL = -DSTANDALONE -g -O2 -Wall -D_FILE_OFFSET_BITS=64
CFLAGS_LOCAL = -DSTANDALONE -Wall -D_FILE_OFFSET_BITS=64 $(shell $(PKG_CONFIG) glib-2.0 --cflags) $(shell $(PKG_CONFIG) --cflags json-c)
FO_LDFLAGS = $(shell $(PKG_CONFIG) glib-2.0 --libs) $(shell $(PKG_CONFIG) --libs json-c) -lpthread -lrt
all: encode $(EXE)
debug: nomos-gl
$(EXE): nomos.o $(OBJS) $(GENOBJS)
$(CC) nomos.o $(OBJS) $(GENOBJS) $(CFLAGS_LOCAL) $(FO_LDFLAGS) -o $(EXE)
nomos.o: nomos.c $(HDRS) $(DB) $(REPO) $(AGENTLIB) $(VARS)
$(CC) -c $< $(CFLAGS_LOCAL) $(DEFS)
nomos-gl: nomos-g.o $(OBJS) $(GENOBJS)
$(CC) nomos.o $(OBJS) $(GENOBJS) $(CFLAGS_LOCAL) -o $@
nomos-g.o: nomos.c $(HDRS) $(DB) $(REPO) $(AGENTLIB) $(VARS)
$(CC) -c -l /usr/lib/libefence.a $< $(CFLAGS_LOCAL)
$(OBJS) $(GENOBJS): %.o: %.c $(HDRS) $(DB) $(VARS)
$(CC) -c $< $(CFLAGS_LOCAL)
#
# Non "standard" preprocessing stuff starts here...
#
encode: encode.o
$(CC) $(CFLAGS) -o $@ $@.c
_precheck.c: _autodata.c $(PRE) $(CHECK)
# @echo "NOTE: _autodata.c has changed --> regenerate _precheck.c"
./$(PRE)
./$(CHECK)
# @$(MAKE) $(STRINGS) $(KEYS)
_autodefs.h _autodata.c: $(SPEC) $(LICFIX)
@echo "NOTE: GENSEARCHDATA takes 1-2 minutes to run"
./$(LICFIX)
#
# Non "standard" preprocessing stuff ends here...
#
install: all
@echo "make nomos standalone agent install"
$(INSTALL_PROGRAM) $(EXE) $(DESTDIR)$(MODDIR)/$(EXE)
uninstall:
@echo "make nomos standalone agent uninstall"
rm -rf $(DESTDIR)$(MODDIR)/$(EXE)
test: all
@echo "*** No tests available for agent/$(EXE) ***"
coverage:
@echo "NOTICE: no coverage available for nomos"
clean:
rm -f encode nomos nomossa *.o core \
_autodata.c _autodefs.c _autodefs.h _precheck.c \
_strings.data _STRFILTER strings.HISTOGRAM words.HISTOGRAM \
split.OTHER checkstr.OK
.PHONY: all install uninstall clean test
include $(DEPS)