Corrected compiler error
[rofl0r-motor.git] / Makefile
blobcbd0115f97423e82bc90861183d16b46f4bb1e4d
1 prefix=/usr/local
2 bindir=$(prefix)/bin
3 datadir=$(prefix)/share
5 SRCS=$(sort $(wildcard src/*.cc src/*/*.cc src/*/*/*.cc kkconsui/src/*.cc kkstrtext/*.cc kksystr/src/*.cc))
6 CSRCS=$(sort $(wildcard parser/src/*.c))
7 COBJS=$(CSRCS:.c=.o)
8 OBJS=$(SRCS:.cc=.o) $(COBJS)
9 INCLUDES=-Isrc -Iparser/include -Ikkstrtext -Isrc/ui -Isrc/project -Isrc/executor \
10 -Isrc/debugger -Isrc/tagbrowser -Ikksystr/include -Isrc/configuration \
11 -Ikkconsui/include -Isrc/manager -Isrc/vcs -Isrc/grepper -Isrc/ui/ncurses
12 PROGS=motor
13 TEMPLATES=$(sort $(wildcard share/templates/* share/templates/*/* share/templates/*/*/*))
14 LIBS=-lncurses
15 LDFLAGS=
16 CFLAGS=-O0 -g3
17 CPPFLAGS=-DINT=intptr_t -DUINT=uintptr_t
18 CXXFLAGS=$(CFLAGS)
20 -include config.mak
22 all: $(PROGS)
24 install: install-progs install-templates
26 install-progs: $(PROGS:%=$(DESTDIR)$(bindir)/%)
27 install-templates: #$(TEMPLATES:share/%=$(DESTDIR)$(datadir)/motor/%)
28 mkdir -p $(DESTDIR)$(datadir)/motor
29 cp -r share/templates $(DESTDIR)$(datadir)/motor/
32 $(DESTDIR)$(bindir)/%: %
33 install -D -m 755 $< $@
35 #$(DESTDIR)$(datadir)/%: share/%
36 # install -D -m 644 $< $@
38 clean:
39 rm -f $(PROGS)
40 rm -f $(OBJS)
42 motor: $(OBJS)
43 $(CXX) -o motor $^ $(LDFLAGS) $(LIBS)
45 %.o: %.cc
46 $(CXX) -DSHARE_DIR=\"$(datadir)/motor\" $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
48 %.o: %.c
49 $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<