1# Makefile for building Coco/R C++ support library from its sources
2# To use this file type "make -f unix.mk [entry-point]"
3# or copy it to "Makefile" to avoid using the "-f unix.mk" option
4# Entry Points:
5# all           (Default) build Coco/R support library
6# clean         Clean all object and executable files
7# dos2unix      Fix source files that have any CR/LF -> LF
8
9# CFLAGS
10#       -O      optimization
11
12#CC sets the name of the compiler to use (cc, gcc, etc)
13#You will have to change this to suit your system
14CC             = ${CXX}
15
16AR              = ar
17CFLAGS          = ${CXXFLAGS}
18DOS2UNIX        = ../dos2unix.sh
19
20.cpp.o:
21		$(CC) -c $(CFLAGS) $< -o $@
22
23.cxx.o:
24		$(CC) -c $(CFLAGS) $< -o $@
25
26all:            cr_lib.a
27
28dos2unix:
29		sh -c "$(DOS2UNIX) '*.c?? *.h?? *.mk'"
30
31cr_lib.a:
32		$(CC) $(CFLAGS) -c cr_abs.c?? cr_error.c?? \
33                                   cr_scan.c?? cr_parse.c??
34		$(AR) -rc cr_lib.a cr_abs.o cr_error.o \
35                                   cr_scan.o cr_parse.o
36
37fix_2_cpp:
38		for i in cr_abs cr_error cr_parse cr_scan;\
39		do (mv $$i.cxx $$i.cpp); done
40
41fix_2_cxx:
42		for i in cr_abs cr_error cr_parse cr_scan;\
43		do (mv $$i.cpp $$i.cxx); done
44
45clean:
46		\rm -f *.o
47		\rm -f *.a
48
49
50
51
52