| 1 |
|
| 2 |
# fixg2sxd - a utility to convert fig to sxd format |
| 3 |
|
| 4 |
# Copyright (C) 2003-2022 Alexander Bürger, [email protected] |
| 5 |
|
| 6 |
# This program is free software; you can redistribute it and/or |
| 7 |
# modify it under the terms of the GNU General Public License as |
| 8 |
# published by the Free Software Foundation; either version 2 of the |
| 9 |
# License, or (at your option) any later version. |
| 10 |
# |
| 11 |
# This program is distributed in the hope that it will be useful, but |
| 12 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
# General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with this program; if not, write to the Free Software |
| 18 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 |
|
| 20 |
# to cross-compile for win32, try: make CXX=i586-mingw32msvc-g++ |
| 21 |
# INCLUDES=-I/tmp/zlib-win32/include LIBS=/tmp/zlib-win32/lib/libz.a |
| 22 |
|
| 23 |
# to put binaries into separate directory (good for cross-compile), go |
| 24 |
# there and try: make -f ..srcdir../Makefile where ..srcdir.. is the |
| 25 |
# path to the source directory |
| 26 |
|
| 27 |
DESTDIR = |
| 28 |
PREFIX = /usr |
| 29 |
SRCDIR := $(dir $(lastword $(MAKEFILE_LIST))) |
| 30 |
|
| 31 |
TARGET1 = fig2sxd$(EXE) |
| 32 |
HEADERS1 = colors.h misc.h styles.h xfigobjects.h xmlwrite.h vector2.h \ |
| 33 |
zipwrite.h |
| 34 |
SOURCES1 = fig2sxd.cpp xfig_arc.cpp xfig_compound.cpp xfig_ellipse.cpp \ |
| 35 |
xfig_poly.cpp xfig_spline.cpp xfig_text.cpp \ |
| 36 |
style_arrow.cpp style_line.cpp style_text.cpp colors.cpp misc.cpp \ |
| 37 |
xmlwrite.cpp zipwrite.cpp keep_range.cpp |
| 38 |
OBJECTS1 = $(SOURCES1:%.cpp=%.o) |
| 39 |
|
| 40 |
TARGETS = $(TARGET1) |
| 41 |
|
| 42 |
DEPEND = .depend- |
| 43 |
DEPFILES = $(SOURCES1:%.cpp=$(DEPEND)%.dep) |
| 44 |
|
| 45 |
|
| •46 |
CXX ?= g++ |
| 47 |
CXXFLAGS += -Wall -W -O2 -g |
| 48 |
CXXFLAGS += $(INCLUDES) |
| 49 |
LIBS = -lz |
| 50 |
|
| 51 |
$(TARGET1): $(OBJECTS1) |
| •52 |
$(CXX) $(LDFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS) |
| 53 |
|
| 54 |
$(OBJECTS1): %.o: $(SRCDIR)%.cpp $(DEPEND)%.dep |
| •55 |
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $< |
| 56 |
|
| 57 |
$(DEPFILES): $(DEPEND)%.dep: $(SRCDIR)%.cpp |
| •58 |
$(CXX) $(CPPFLAGS) $(INCLUDES) -M $< > $@ |
| 59 |
|
| 60 |
-include $(DEPFILES) |
| 61 |
|
| 62 |
clean: |
| 63 |
rm -f $(TARGETS) $(OBJECTS1) |
| 64 |
|
| 65 |
veryclean: clean |
| 66 |
rm -f $(DEPFILES) |
| 67 |
|
| 68 |
all: $(TARGET1) |
| 69 |
|
| 70 |
install: $(TARGET1) $(SRCDIR)/fig2sxd.1 |
| 71 |
install -d $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/share/man/man1 |
| 72 |
install -m755 $(TARGET1) $(DESTDIR)$(PREFIX)/bin |
| 73 |
install -m644 $(SRCDIR)/fig2sxd.1 $(DESTDIR)$(PREFIX)/share/man/man1 |
| 74 |
|
| 75 |
.PHONY: all clean |