Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/compiler/makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download)
Wed Aug 3 10:14:23 2011 UTC (12 years, 9 months ago) by kaityo
File size: 3113 byte(s)
First commit
1 # =============================================================================
2 # Makefile for qcompiler
3 # =============================================================================
4
5 .SUFFIXES: .cpp
6
7 all: qcrun qcpp
8
9 # Binary file name
10 BINNAME=qcrun
11 BINNAME2=qcpp
12
13 # Normal compiler
14 CC=g++
15
16 # Where to install
17 INSTDIR = ~/bin
18
19 # Compile options
20 PATH_ROOT = ../calcunits
21 PATH_UNITS = ../calcunits
22 PATH_LIB = ../qclib
23 IFLAGS = -I. -I${PATH_ROOT} -I${PATH_UNITS}
24 CFLAGS = -mno-cygwin -Wall -O4
25 #CFLAGS = -O2
26 LFLAGS = -lm
27
28 # -----------------------------------------------------------------------------
29 # Compiler
30 # -----------------------------------------------------------------------------
31 QCompiler.o: QCompiler.cpp QCompiler.h QParseInfo.h
32 ${CC} ${IFLAGS} ${CFLAGS} -c QCompiler.cpp -o QCompiler.o
33
34 QCompilerCntl.o: QCompilerCntl.cpp QCompilerCntl.h QCompiler.h QParseInfo.h ${PATH_UNITS}/QCalcUnit.h ${QC_UNITS_H}
35 ${CC} ${IFLAGS} ${CFLAGS} -c QCompilerCntl.cpp -o QCompilerCntl.o
36
37 QParseInfo.o: QParseInfo.h
38 ${CC} ${IFLAGS} ${CFLAGS} -c QParseInfo.cpp -o QParseInfo.o
39
40 QBits.o: ${PATH_ROOT}/QBits.cpp ${PATH_ROOT}/QBits.h
41 ${CC} ${IFLAGS} ${CFLAGS} -c ${PATH_ROOT}/QBits.cpp -o QBits.o
42
43 QCalcManager.o: ${PATH_ROOT}/QCalcManager.cpp ${PATH_ROOT}/QCalcManager.h QCompilerCntl.h ${PATH_ROOT}/QBits.h ${PATH_UNITS}/QCalcUnit.h
44 ${CC} ${IFLAGS} ${CFLAGS} -c ${PATH_ROOT}/QCalcManager.cpp -o QCalcManager.o
45
46 QCompilerCode.o: QCompilerCode.cpp QCompilerCode.h QCompiler.h QParseInfo.h
47 $(CC) $(IFLAGS) $(CFLAGS) -c QCompilerCode.cpp -o QCompilerCode.o
48
49 qcrun.o: qcrun.cpp ${PATH_ROOT}/QBits.h ${PATH_ROOT}/QCalcManager.h
50 ${CC} ${IFLAGS} ${CFLAGS} -c qcrun.cpp -o qcrun.o
51
52 qcpp.o: qcpp.cpp QCompilerCode.h QCompiler.h
53 $(CC) $(IFLAGS) $(CFLAGS) -c qcpp.cpp -o qcpp.o
54 # -----------------------------------------------------------------------------
55 $(BINNAME): qcrun.o QCalcManager.o QCompiler.o QCompilerCntl.o QParseInfo.o ${PATH_LIB}/qclib.a
56 ${CC} ${IFLAGS} -o ${BINNAME} qcrun.o QCalcManager.o QCompiler.o QCompilerCntl.o QParseInfo.o ${CFLAGS} ${LFLAGS} ${PATH_LIB}/qclib.a
57
58 $(BINNAME2): qcpp.o QCompilerCode.o QCompiler.o QParseInfo.o
59 $(CC) $(IFLAGS) -o $(BINNAME2) qcpp.o QCompilerCode.o QCompiler.o QParseInfo.o $(CFLAGS) $(LFLAGS)
60
61 # -----------------------------------------------------------------------------
62 # Other functions
63 # -----------------------------------------------------------------------------
64 clean:
65 -rm -f *.o ${BINNAME} $(BINNAME2)
66 -rm -f ${BINNAME}.exe $(BINNAME2).exe
67 -rm -f *.~* *.obj
68
69 # -----------------------------------------------------------------------------
70 install: qcompiler
71 @if [ -d ${INSTDIR} ]; \
72 then \
73 cp ${OPT_BINNAME} ${INSTDIR}; \
74 chmod 711 ${INSTDIR}/${OPT_BINNAME}; \
75 echo "Installed in ${INSTDIR}"; \
76 else \
77 echo "Sorry, ${INSTDIR} does not exist."; \
78 fi
79
80 # -----------------------------------------------------------------------------
81 uninstall:
82 @if [ -e ${INSTDIR}/${OPT_BINNAME} ]; \
83 then \
84 -rm ${INSTDIR}/${OPT_BINNAME}; \
85 echo "unnstalled successfully."; \
86 else \
87 echo "Sorry, ${INSTDIR}/${OPT_BINNAME} does not exist."; \
88 fi

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26