mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 10:54:22 -05:00
3be22536df
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5953 b45a01b8-16f6-495d-af2f-9b41ad6348cc
43 lines
1.0 KiB
Makefile
43 lines
1.0 KiB
Makefile
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
|
ifneq (,$(findstring MINGW,$(uname_S)))
|
|
X = .exe
|
|
endif
|
|
|
|
export X
|
|
|
|
PROGRAM=markdown$(X)
|
|
CFLAGS ?= -Wall -O3 -ansi -D_GNU_SOURCE # -flto for newer GCC versions
|
|
OBJS=markdown_parser.o markdown_output.o markdown_lib.o utility_functions.o parsing_functions.o odf.o
|
|
PEGDIR=peg-0.1.9
|
|
LEG=$(PEGDIR)/leg$(X)
|
|
PKG_CONFIG = pkg-config
|
|
|
|
ALL : $(PROGRAM)
|
|
|
|
$(LEG): $(PEGDIR)
|
|
CC=gcc make -C $(PEGDIR)
|
|
|
|
%.o : %.c markdown_peg.h
|
|
$(CC) -c `$(PKG_CONFIG) --cflags glib-2.0` $(CFLAGS) -o $@ $<
|
|
|
|
$(PROGRAM) : markdown.c $(OBJS)
|
|
$(CC) `$(PKG_CONFIG) --cflags glib-2.0` $(CFLAGS) -o $@ $< $(OBJS) `$(PKG_CONFIG) --libs glib-2.0`
|
|
|
|
markdown_parser.c : markdown_parser.leg $(LEG) markdown_peg.h parsing_functions.c utility_functions.c
|
|
$(LEG) -o $@ $<
|
|
|
|
.PHONY: clean test
|
|
|
|
clean:
|
|
rm -f markdown_parser.c $(PROGRAM) $(OBJS)
|
|
|
|
distclean: clean
|
|
make -C $(PEGDIR) clean
|
|
\
|
|
test: $(PROGRAM)
|
|
cd MarkdownTest_1.0.3; \
|
|
./MarkdownTest.pl --script=../$(PROGRAM) --tidy
|
|
|
|
leak-check: $(PROGRAM)
|
|
valgrind --leak-check=full ./markdown README
|