]> mj.ucw.cz Git - leo.git/blobdiff - Makefile
configure: libfreetype2 uses pkg-config these days
[leo.git] / Makefile
index c0b1642274b438c1b3a1b753f30a058a8ed1e3e6..036bcda70d56be1850bac53145d49937501b5ad5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,63 +1,51 @@
-LIBUCW:=$(shell cd /home/mj/src/libucw/run && pwd)
-UCWCF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --cflags libucw libucw-charset libucw-xml)
-UCWLF:=$(shell PKG_CONFIG_PATH=$(LIBUCW)/lib/pkgconfig pkg-config --libs libucw libucw-charset libucw-xml)
-FTCF:=$(shell freetype-config --cflags)
-FTLF:=$(shell freetype-config --libs)
-PANGOCF:=$(shell pkg-config pangoft2 --cflags)
-PANGOLF:=$(shell pkg-config pangoft2 --libs)
-
-CC=gcc
-LD=gcc
-COPT=-O2
-CFLAGS=$(COPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -Wundef -Wredundant-decls -Wno-missing-field-initializers -std=gnu99 $(UCWCF) -ggdb -DDEBUG_ASSERTS
-LDLIBS+=$(FTLF) $(PANGOLF) $(UCWLF) -lproj
-
-all: leo
-
-leo: leo.o xml.o osm.o svg.o svg-icon.o css-parse.o css-lex.o style.o css.o dict.o sym.o sym-point.o sym-line.o sym-text.o map.o shp.o
-
-INC=leo.h dict-keys.h dict-values.h dict-props.h osm.h svg.h style.h css.h dict.h map.h sym.h
-
-leo.o: leo.c $(INC)
-xml.o: xml.c $(INC)
-osm.o: osm.c $(INC)
-svg.o: svg.c $(INC)
-svg-icon.o: svg-icon.c $(INC)
-style.o: style.c $(INC)
-css.o: css.c $(INC)
-dict.o: dict.c $(INC)
-sym.o: sym.c $(INC)
-sym-point.o: sym-point.c $(INC)
-sym-line.o: sym-line.c $(INC)
-sym-text.o: sym-text.c $(INC)
-css-parse.o: css-parse.c $(INC)
-css-lex.o: css-lex.c $(INC) css-parse.c
-map.o: map.c $(INC)
-shp.o: shp.c $(INC)
-
-sym-text.o: CFLAGS+=$(FTCF) $(PANGOCF)
-
-css-parse.c: css-parse.y
-       bison --name-prefix=css_ --token-table --verbose --defines -o $@ $^
+# Makefile for Hic Est Leo
+
+all: runtree programs extras configs
+
+# Include configuration
+s=.
+-include obj/config.mk
+obj/config.mk:
+       @echo "You need to run configure first." && false
+
+BUILDSYS=$(s)/build
+
+# We will use the libucw build system
+include $(BUILDSYS)/Maketop
 
-dict-%.h: dict-%.t gen-dict
-       ./gen-dict <$< >$@
+PROGS+=$(o)/leo
+CFLAGS+=$(LIBUCW_CFLAGS)
 
-clean:
-       rm -f leo *.o css-parse.c css-parse.h css-parse.output tags
-       rm -f dict-keys.h dict-values.h dict-props.h
+LEO_MODULES=leo xml osm svg svg-icon css-parse css-lex style css dict sym sym-point sym-line sym-text map shp fixed
+LEO_OBJECTS=$(addprefix $(o)/, $(addsuffix .o, $(LEO_MODULES)))
+$(o)/leo: $(LEO_OBJECTS)
 
-tags:
-       ctags *.[chy]
+$(o)/leo: LIBS+=$(LIBUCW_LIBS) $(LIBUCW_CHARSET_LIBS) $(LIBUCW_XML_LIBS) $(PANGOFT2_LIBS) $(FREETYPE_LIBS) -lproj -lm
 
-upload:
-       rs output.pdf ps:poskole-beta/www/tmp/2014/mapa.pdf
+$(o)/sym-text.o: CFLAGS+=$(FREETYPE_CFLAGS) $(PANGOFT2_CFLAGS)
+$(o)/svg-icon.o: CFLAGS+=$(LIBUCW_XML_CFLAGS)
+$(o)/xml.o: CFLAGS+=$(LIBUCW_XML_CFLAGS)
 
-backup:
-       rs . camelot:a/priv/poskole/map/new/$$(date '+%Y%m%d-%H%M%S')/
+$(LEO_OBJECTS): $(o)/dict-keys.h $(o)/dict-props.h $(o)/dict-values.h
 
-output.svg: leo dump.osm poskole.css
-       ./leo
+$(o)/css-parse.c: css-parse.y
+       bison --name-prefix=css_ --token-table --verbose --defines -o $@ $^
+
+$(o)/dict-%.h: dict-%.t $(BUILDSYS)/gen-dict
+       build/gen-dict <$< >$@
+
+ifndef CONFIG_LOCAL
+install: all $(INSTALL_TARGETS)
+else
+install:
+       @echo "Nothing to install, this is a local build." && false
+endif
+.PHONY: install
+
+output.svg: $(o)/leo dump.osm poskole.css
+       $(o)/leo
 
 output.pdf: output.svg
        inkscape --export-pdf=output.pdf output.svg
+
+include $(BUILDSYS)/Makebottom