-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (82 loc) · 3.13 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# Copyright (c) 2019 European Spallation Source ERIC
#
# The program is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of the
# License, or any newer version.
#
# 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 General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt
#
#
# Author : Jeong Han Lee
# email : [email protected]
# Date : Wednesday, November 27 12:01:40 CET 2019
# version : 0.0.2
#
TOP:=$(CURDIR)
ifeq ($(DESTDIR),)
DESTDIR := $(TOP)/bin
endif
APPINC:=$(TOP)/include
APPLIB:=$(TOP)/lib
TSCMON:=$(TOP)/src/TscMon
TSCTST:=$(TOP)/src/TscTst
VPATH = $(APPINC) $(APPLIB) $(TSCMON) $(TSCTST)
CPPFLAGS += -I $(APPINC)
CPPFLAGS += -I $(TSCMON)
CPPFLAGS += -I $(TSCTST)
TSCLIB_SRCS := tsculib.c clilib.c tscextlib.c tstlib.c ponmboxlib.c \
mtca4amclib.c mtca4rtmlib.c pca9539lib.c i2ceepromlib.c \
fbi1482lib.c rcf1450lib.c rsp1461lib.c rdt1465lib.c rcc1466lib.c \
fmclib.c ltc2489lib.c dacwgenlib.c
ADCLIB_SRCS := adclib.c adc3112lib.c fscope3112lib.c adc3110lib.c gscopelib.c \
gscope3110lib.c adc3117lib.c adc3210lib.c daq1430lib.c lmklib.c \
xilinxlib.c ads42lb69lib.c dac38j84lib.c scope1430lib.c zdclib.c
TSCMON_SRCS := TscMon.c script.c rdwr.c conf.c map.c mbox.c amc.c rtm.c dma.c
TSCMON_SRCS += timer.c sflash.c buf.c tst.c semaphore.c fifo.c lmk.c
TSCMON_SRCS += ddr.c i2c.c adc3110.c adc3117.c adc3112.c acq1430.c alias.c
TSCMON_SRCS += tdma.c fbi1482.c rcf1450.c rsp1461.c rdt1465.c rcc1466.c gscope.c
SMEMCA_SRCS := SmemCalibration.c
#TSCTST_SRCS := $(wildcard $(TSCTST)/*.c)
TSCLIB_OBJS :=$(addsuffix .o,$(basename $(TSCLIB_SRCS)))
ADCLIB_OBJS :=$(addsuffix .o,$(basename $(ADCLIB_SRCS)))
TSCMON_OBJS :=$(addsuffix .o,$(basename $(TSCMON_SRCS)))
SMEMCA_OBJS :=$(addsuffix .o,$(basename $(SMEMCA_SRCS)))
TSCTST_OBJS :=$(addsuffix .o,$(basename $(TSCTST_SRCS)))
TSBLIB:= libtsc.so
ADCLIB:= libadc.so
CFLAGS := -Wall
LDFLAGS :=-Wall -lrt -lm
BINS := TscMon SmemCalibration
build: $(BINS)
TscMon: $(TSCMON_OBJS) $(ADCLIB_OBJS) $(TSCLIB_OBJS)
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
SmemCalibration: $(SMEMCA_OBJS) $(TSCLIB_OBJS)
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
TscTst: $(TSCTST_OBJS) $(TSCMON_OBJS)
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
$(TSBLIB): $(TSCLIB_OBJS)
$(CXX) -shared -fPIC $(LDFLAGS) -o $@ $^
$(ADCLIB): $(ADCLIB_OBJS) $(TSCLIB_OBJS)
$(CXX) -shared -fPIC $(LDFLAGS) -o $@ $^
.c.o :
$(COMPILE.c) $(OUTPUT_OPTION) $<
install: $(BINS)
install -d $(DESTDIR)/
install -m 755 $^ $(DESTDIR)/
.PHONY: distclean clean build install
clean:
@$(RM) $(SMEMCA_OBJS) $(TSCMON_OBJS) $(ADCLIB_OBJS) $(TSCLIB_OBJS)
distclean: clean
@$(RM) $(BINS)
@$(RM) -r $(DESTDIR)
PRINT.%:
@echo $* = $($*)
@echo $*\'s origin is $(origin $*)