-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (76 loc) · 2.17 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
92
###############################################################################
# Copyright (c) 2020 Southeastern Universities Research Association,
# Thomas Jefferson National Accelerator Facility
#
# This software was developed under a United States Government license
# described in the NOTICE file included as part of this distribution.
#
# Author: Bryan Moffit
# [email protected] Jefferson Lab, MS-12B3
# Phone: (757) 269-5660 12000 Jefferson Ave.
# Fax: (757) 269-5800 Newport News, VA 23606
#
###############################################################################
#
# Description:
# Makefile for the dalogMsg archiver (dalma)
#
###############################################################################
# Uncomment DEBUG line, to include some debugging info ( -g and -Wall)
DEBUG ?= 1
QUIET ?= 1
#
ifeq ($(QUIET),1)
Q = @
else
Q =
endif
ARCH ?= $(shell uname -m)
# Check for CODA 3 environment
ifndef CODA_LIB
CODA = /daqfs/coda/3.10_devel
CODA_LIB = ${CODA}/Linux-x86_64/lib
endif
INC_CMSG ?= -I${CODA}/common/include
LIB_CMSG ?= -L${CODA_LIB}
# Safe defaults for installation
LINUXVME_LIB ?= ../lib
LINUXVME_INC ?= ../include
LINUXVME_BIN ?= ../bin
CC = gcc
AR = ar
RANLIB = ranlib
INCS = -I. ${INC_CMSG}
LIBINCS = -I.
CFLAGS = -D_GNU_SOURCE
CFLAGS += -rdynamic
CFLAGS += -L. ${LIB_CMSG}
LIBCFLAGS = ${CFLAGS} -L.
ifdef DEBUG
CFLAGS += -Wall -g
else
CFLAGS += -O2
endif
SRC = dalma.c
DEPS = $(SRC:.c=.d)
PROG = dalma
LIBSRC = dalmaRolLib.c
LIBHDR = dalmaRolLib.h
LIB = libdalmaRol.so
all: $(PROG) $(LIB)
$(PROG): dalma.c
@echo " CC $@"
${Q}$(CC) $(CFLAGS) -lrt -ldl -lcmsg -lcmsgRegex $(INCS) -o $@ $<
%.so: $(LIBSRC)
@echo " CC $@"
${Q}$(CC) -fpic -shared $(LIBCFLAGS) $(LIBINCS) -o $@ $(LIBSRC)
%.d: %.c
@echo " DEP $@"
@set -e; rm -f $@; \
$(CC) -MM -shared $(INCS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1 $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
-include $(DEPS)
clean:
@rm -vf ${PROG} *.{d,o,a,so} *~
.PHONY: clean