source: ETALON/CLIO/savedata/makefile @ 756

Last change on this file since 756 was 756, checked in by delerue, 6 years ago

Importing savedata

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