~adrian-arroyocalle/freerct/freerct

« back to all changes in this revision

Viewing changes to src/rcdgen/Makefile

  • Committer: charlespigott at googlemail
  • Date: 2013-07-09 17:30:05 UTC
  • Revision ID: svn-v4:d3bf82d2-0c16-e458-5408-27be57bd1276:trunk:780
-Codechange: Reorganise the project files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id$
 
2
#
 
3
# This file is part of FreeRCT.
 
4
# FreeRCT 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, version 2.
 
5
# FreeRCT 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.
 
6
# See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FreeRCT. If not, see <http://www.gnu.org/licenses/>.
 
7
#
 
8
 
 
9
.PHONY: clean
 
10
 
 
11
CXX=g++
 
12
CXXFLAGS=-Wall -g
 
13
INCLUDES=
 
14
LIBS=-lpng
 
15
 
 
16
BISON=bison
 
17
FLEX=flex
 
18
 
 
19
CXXFILES=ast.cpp check_data.cpp ../getoptdata.cpp image.cpp file_writing.cpp \
 
20
        nodes.cpp parser.cpp rcdgen.cpp scanner.cpp scanner_funcs.cpp
 
21
 
 
22
OBJDIR=../objects/rcdgen
 
23
OBJFILES=$(addprefix $(OBJDIR)/,$(CXXFILES:.cpp=.o))
 
24
DEPEND=$(OBJDIR)/depend-rcdgen.txt
 
25
TARGET=rcdgen
 
26
 
 
27
 
 
28
$(TARGET): $(DEPEND) $(OBJFILES)
 
29
        $(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJFILES) $(LIBS)
 
30
 
 
31
$(OBJDIR)/%.o: %.cpp
 
32
        $(CXX) -c $(CXXFLAGS) -o $@ $(INCLUDES) $<
 
33
 
 
34
$(DEPEND): $(CXXFILES)
 
35
        for f in $(CXXFILES);\
 
36
        do $(CXX) -MM $(CXXFLAGS) $(INCLUDES) $$f;\
 
37
        done > $(DEPEND)
 
38
 
 
39
clean:
 
40
        for i in $(OBJFILES) $(DEPEND) $(TARGET);\
 
41
        do if test -f $$i; then rm $$i; fi;\
 
42
        done
 
43
 
 
44
tokens.h parser.cpp: parser.y
 
45
        $(BISON) --defines=tokens.h --output=parser.cpp parser.y
 
46
 
 
47
scanner.cpp scanner.h: scanner.l
 
48
        $(FLEX) --outfile=scanner.cpp scanner.l
 
49
 
 
50
ifndef NODEPS
 
51
-include $(DEPEND)
 
52
endif