summaryrefslogtreecommitdiff
path: root/Makefile
blob: b1432309ce171c8ab9c6ee383d2ff7f2e46a1d1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CXX=c++
CXXFLAGS=-g -I./include -I./stfl -I. -I/usr/local/include -I/sw/include -Wall
LDFLAGS=-L/usr/local/lib -L/sw/lib
LIBS=-lstfl -lmrss -lnxml -lncurses -lsqlite3 -lidn
OUTPUT=noos
SRC=$(wildcard *.cpp) $(wildcard src/*.cpp)
OBJS=$(patsubst %.cpp,%.o,$(SRC))
prefix=/usr/local
MKDIR=mkdir -p
INSTALL=install
GZIP=gzip -9

STFLHDRS=$(patsubst %.stfl,%.h,$(wildcard stfl/*.stfl))

STFLCONV=./stfl2h.pl
RM=rm -f

all: $(OUTPUT)

$(OUTPUT): $(STFLHDRS) $(OBJS)
	$(CXX) $(LDFLAGS) $(CXXFLAGS) -o $(OUTPUT) $(OBJS) $(LIBS)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -o $@ -c $<

%.h: %.stfl
	$(STFLCONV) $< > $@

testpp: src/xmlpullparser.cpp testpp.cpp
	$(CXX) -I./include -pg -g -D_TESTPP src/xmlpullparser.cpp testpp.cpp -o testpp

clean:
	$(RM) $(OUTPUT) $(OBJS) $(STFLHDRS) core *.core

distclean: clean
	$(RM) Makefile.deps

install:
	$(MKDIR) $(prefix)/bin
	$(INSTALL) $(OUTPUT) $(prefix)/bin
	$(MKDIR) $(prefix)/share/man/man1
	$(INSTALL) doc/$(OUTPUT).1 $(prefix)/share/man/man1
	$(GZIP) $(prefix)/share/man/man1/$(OUTPUT).1

uninstall:
	$(RM) $(prefix)/bin/$(OUTPUT)
	$(RM) $(prefix)/share/man/man1/$(OUTPUT).1.gz

Makefile.deps: $(SRC)
	$(CXX) $(CXXFLAGS) -MM -MG $(SRC) > Makefile.deps

include Makefile.deps