1#
2# The contents of this file are subject to the Mozilla Public
3# License Version 1.1 (the "License"); you may not use this file
4# except in compliance with the License. You may obtain a copy of
5# the License at http://www.mozilla.org/MPL/
6#
7# Software distributed under the License is distributed on an "AS
8# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9# implied. See the License for the specific language governing
10# rights and limitations under the License.
11#
12# The Original Code is State Machine Compiler (SMC).
13#
14# The Initial Developer of the Original Code is Charles W. Rapp.
15# Portions created by Charles W. Rapp are
16# Copyright (C) 2000 Charles W. Rapp.
17# All Rights Reserved.
18#
19# Contributor(s):
20#
21# RCS ID
22# $Id: Makefile,v 1.5 2005/05/28 13:31:18 cwrapp Exp $
23#
24# CHANGE LOG
25# $Log: Makefile,v $
26# Revision 1.5  2005/05/28 13:31:18  cwrapp
27# Updated C++ examples.
28#
29# Revision 1.0  2003/12/14 19:39:20  charlesr
30# Initial revision
31#
32
33CXX       = c++
34# CPPFLAGS  = -D_DEBUG -g -I. -I../../../lib/C++
35CPPFLAGS  = -g -I. -I../../../lib
36SMC       = java -jar ../../../bin/Smc.jar
37SMCFLAGS  = -c++ -g
38
39FSMS           = 	TcpConnection.sm
40
41COMMON_SOURCES = 	TcpConnection_sm.cpp \
42			Eventloop.cpp \
43			TcpSegment.cpp \
44			TcpConnection.cpp \
45			TcpClient.cpp \
46			TcpServer.cpp
47
48SERVER_SOURCES = 	AppServer.cpp \
49			AppClient.cpp \
50			server.cpp
51
52CLIENT_SOURCES =	AppClient.cpp \
53			AppServer.cpp \
54			client.cpp
55
56COMMON_OBJECTS =	$(COMMON_SOURCES:.cpp=.o)
57SERVER_OBJECTS =	$(SERVER_SOURCES:.cpp=.o)
58CLIENT_OBJECTS =	$(CLIENT_SOURCES:.cpp=.o)
59
60##############
61
62%_sm.h %_sm.cpp : %.sm
63	$(SMC) $(SMCFLAGS) $<
64
65%.o :	%.cpp
66	$(CXX) $(CPPFLAGS) -c $<
67
68all : server client
69
70common : $(COMMON_OBJECTS)
71
72server : common $(SERVER_OBJECTS)
73	$(CXX) -g -o $@ $(COMMON_OBJECTS) $(SERVER_OBJECTS)
74
75client : common $(CLIENT_OBJECTS)
76	$(CXX) -g -o $@ $(COMMON_OBJECTS) $(CLIENT_OBJECTS)
77
78clean :
79	-rm -f server \
80                client \
81		$(COMMON_OBJECTS) \
82		$(SERVER_OBJECTS) \
83                $(CLIENT_OBJECTS) \
84		*_sm.h \
85		*_sm.cpp \
86		core
87