source: ETALON/DAQ/makefile @ 751

Last change on this file since 751 was 4, checked in by delerue, 11 years ago

Added DAQ software (version without trigger)

File size: 2.1 KB
Line 
1# $URL: http://subversion:8080/svn/gsc/trunk/drivers/LINUX/18AI32SSC1M/savedata/makefile $
2# $Rev: 13752 $
3# $Date: 2012-01-12 13:01:05 -0600 (Thu, 12 Jan 2012) $
4
5DEVICE          = 18ai32ssc1m
618AI32_BASEDIR = /home/delerue/DAQ/18ai32ssc1m
7default:        all
8
9CC                      = gcc
10CC_FLAGS        = -c -Wall
11CC_FLAGS        += -I.
12CC_FLAGS        += -I${18AI32_BASEDIR}/driver
13CC_FLAGS        += -I${18AI32_BASEDIR}/docsrc
14CC_FLAGS        += -I${18AI32_BASEDIR}/utils
15DEP_FILE        = makefile.dep
16LIB_FILES       =  ${18AI32_BASEDIR}/utils/${DEVICE}_utils.a
17LIB_FILES       += ${18AI32_BASEDIR}/docsrc/${DEVICE}_dsl.a
18LIB_FILES       += ${18AI32_BASEDIR}/utils/gsc_utils.a
19TARGET          = savedataSPESO
20VPATH           =
21
22ECHO    := ${shell ls /bin/echo 2>/dev/null | wc -l}
23ifeq ("${ECHO}","1")
24ECHO    := /bin/echo
25else
26ECHO    := echo
27endif
28
29OBJ_FILES       =                       \
30                        main.o          \
31                        savedata.o
32
33.c.o:
34        @echo == Compiling: $<
35        @-chmod +rw ${DEP_FILE}
36        @# Get the dependency list for this module.
37        @-${CC} -MM ${CC_FLAGS} $< > .tmp1
38        @# Remove the trailing white space and backslash.
39        @-sed -e "s/[ ]*[\\\\]//g" < .tmp1 > .tmp2
40        @# Put everything on seperate lines.
41        @-tr [:space:] \\n < .tmp2 > .tmp3
42        @# Remove all of the system include files.
43        @-grep -v "^[ ]*/" < .tmp3 > .tmp4
44        @# Remove all empty lines.
45        @-grep [[:alnum:]] < .tmp4 > .tmp5
46        @# Put everything on the same line.
47        @-tr '\n' '\040' < .tmp5 > .tmp6
48        @-${ECHO} -e '\012' >> .tmp6
49        @# Add all of the other dependencies to the end of this file.
50        @-echo >> ${DEP_FILE}
51        @-grep -v "^[ ]*$@" < ${DEP_FILE} >> .tmp6
52        @# Remove blank lines from the list.
53        @-grep "[[:alnum:]]" < .tmp6 > .tmp7
54        @# Sort the list and put it in the dependency file.
55        @-sort < .tmp7 > ${DEP_FILE}
56        @# Cleanup.
57        @rm -f ${DEP_FILE}.tmp* .tmp*
58        @# Compile the module.
59        @${CC} ${CC_FLAGS} $< -o $@
60
61
62
63all: ${TARGET}
64        @echo ==== All Done
65
66release: ${TARGET}
67        @rm -f *.a *.o ${OBJ_FILES}
68        @echo ==== Release Done
69
70clean:
71        @echo ==== Cleaning ${TARGET} ...
72        @rm -f *.a *.o *.scc ${TARGET}
73        @-chmod +rw ${DEP_FILE}
74        @echo > ${DEP_FILE}
75
76${TARGET}: ${OBJ_FILES} ${LIB_FILES}
77        @echo ==== Linking: $@
78        @${CC} ${OBJ_FILES} ${LIB_FILES} -lm -lpthread -o $@
79
80${DEP_FILE}:
81        @echo ==== Creating: $@
82        @echo > ${DEP_FILE}
83
84include ${DEP_FILE}
Note: See TracBrowser for help on using the repository browser.