]> Shamusworld >> Repos - architektonas/blob - dxflib/Makefile
Removed Snapper class; still refactoring Snapper/Preview...
[architektonas] / dxflib / Makefile
1 #
2 #
3 # Makefile for dxflib
4 #
5 #
6 VERSION = 2.0.4.8
7
8 #
9 # dxflib installation directories
10 #
11 LIBDIR = /usr/local/lib
12 INCDIR = /usr/local/include/dxflib
13
14 #PREFIX ?= /usr
15
16 #LIBDIR = $(DESTDIR)$(PREFIX)/lib
17 #INCDIR = $(DESTDIR)$(PREFIX)/include/dxflib
18
19
20 #LIBDIR = $(HOME)/local/lib
21 #INCDIR = $(HOME)/local/include/dxflib
22
23 #
24 #------------------------ do not edit ------------------------
25 #
26 SHELL = /bin/sh
27
28 CC           = gcc
29 CXX          = gcc
30 CFLAGS       = -I./src -g -O2  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DLINUX=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 
31 INSTALL      = /usr/bin/install -c
32 INSTALL_DATA = ${INSTALL} -m 644
33 FIND         = find
34 MAKEDEPEND   = makedepend
35 AR           = ar
36 ARFLAGS      = -rs
37
38 BASE_DIR = ./src
39
40 BASE_SRC = \
41                 $(BASE_DIR)/dl_dxf.cpp \
42                 $(BASE_DIR)/dl_writer_ascii.cpp
43
44 BASE_INS = \
45                 $(BASE_DIR)/dl_attributes.h \
46                 $(BASE_DIR)/dl_codes.h \
47                 $(BASE_DIR)/dl_creationadapter.h \
48                 $(BASE_DIR)/dl_creationinterface.h \
49                 $(BASE_DIR)/dl_dxf.h \
50                 $(BASE_DIR)/dl_entities.h \
51                 $(BASE_DIR)/dl_exception.h \
52                 $(BASE_DIR)/dl_extrusion.h \
53                 $(BASE_DIR)/dl_writer.h \
54                 $(BASE_DIR)/dl_writer_ascii.h
55
56 SRC = $(BASE_SRC)
57 OBJ = $(SRC:.cpp=.o)
58
59 INS =  $(BASE_INS)
60
61 .cpp.o:  
62         $(CXX) $(CFLAGS) -c $< -o $@
63
64
65 all: prepare ./lib/libdxf.a
66
67 prepare:
68         test -d ./include || mkdir -p ./include
69         -( cd ./include; rm -f *.h; \
70         for hf in `find ../src -name '*.h'`; do \
71                 if [ "x$$OS" = "xWindows_NT" ]; then \
72                         cp "$$hf" .; \
73                 else \
74                         ln -s "$$hf" 2> /dev/null; \
75                 fi \
76         done )
77
78 shared: ./lib/libdxf.so.$(VERSION)
79         @echo
80
81 ./lib/libdxf.a: $(OBJ) 
82         test -d ./lib || mkdir ./lib
83         $(AR) $(ARFLAGS) ./lib/libdxf.a $(OBJ)
84
85 ./lib/libdxf.so.$(VERSION): $(OBJ)
86         test -d ./lib || mkdir ./lib
87         $(CC) -p -shared -o ./lib/libdxf.so.$(VERSION) $(OBJ) -lc -lm
88         -(cd ./lib ; ln -s libdxf.so.$(VERSION) libdxf.so)
89
90 install: ./lib/libdxf.a
91         test -d $(LIBDIR) || mkdir -p $(LIBDIR)
92         test -d $(INCDIR) || mkdir -p $(INCDIR)
93         $(INSTALL_DATA) ./lib/libdxf.a $(LIBDIR)
94         #-(ln -s $(LIBDIR)/libdxf.a $(LIBDIR)/libdxf.a)
95         for IFILE in $(INS); do \
96                 $(INSTALL_DATA) $$IFILE  $(INCDIR); \
97         done
98
99 install-shared: ./lib/libdxf.so.$(VERSION)
100         test -d $(LIBDIR) || mkdir -p $(LIBDIR)
101         test -d $(INCDIR) || mkdir -p $(INCDIR)
102         #$(INSTALL_DATA) ./lib/libdxf.so.$(VERSION) $(LIBDIR)
103         -(ln -s $(LIBDIR)/libdxf.so.$(VERSION) $(LIBDIR)/libdxf.so)
104         for IFILE in $(INS); do \
105                 $(INSTALL_DATA) $$IFILE  $(INCDIR); \
106         done
107
108 clean:
109         -(cd ./test ; make clean)
110         -rm -f $(OBJ)
111         -rm -f ./lib/lib* Makefile.bak
112         -rm -f ./include/dxflib/*.h
113         -$(FIND) . -name "*~" -exec rm -f {} \;
114         -rm -f ./lib/libdxf.a
115   
116 distclean: clean
117         -rm -f Makefile configure
118
119 testing:        ./lib/libdxf.a
120         (cd ./test ; make)
121
122 docu:
123         -(doxygen ./doxygen.cfg)
124
125 dist:   clean docu
126         #-rm -r ./doc/classref/html/en/*
127         -rm -r ./distribution/dxflib/*
128         test -d ./distribution/dxflib || mkdir -p ./distribution/dxflib
129         mkdir -p ./distribution/dxflib/doc
130         -(cp -r ./src ./test ./distribution/dxflib/)
131         -(cp -r ./doc/classref ./distribution/dxflib/doc/)
132         -(cp * ./distribution/dxflib/)
133         -(cd ./distribution/dxflib; rm config.log config.cache reinstall*; mkdir lib include)
134         -(cd ./distribution; tar fvcz dxflib-$(VERSION).tar.gz dxflib)
135
136 depend:
137         $(MAKEDEPEND) -- $(CFLAGS) -- $(SRC)
138         @echo
139         @echo "Run 'make' to build dxflib library."
140         @echo
141
142 # DO NOT DELETE THIS LINE -- make  depend  depends  on it.