xglcomp

annotate Makefile @ 0:d9b3fba68705

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 21 Jan 2016 08:45:31 +0200
parents
children b2b7cb950c28
rev   line source
nuclear@0 1 PREFIX = /usr/local
nuclear@0 2
nuclear@0 3 ccsrc = $(wildcard src/*.cc)
nuclear@0 4 csrc = $(wildcard src/*.c) $(wildcard src/optcfg/*.c)
nuclear@0 5 obj = $(csrc:.c=.o) $(ccsrc:.cc=.o)
nuclear@0 6 dep = $(obj:.o=.d)
nuclear@0 7 bin = xglcomp
nuclear@0 8
nuclear@0 9 warn = -pedantic -Wall
nuclear@0 10 dbg = -g
nuclear@0 11 opt = -O0
nuclear@0 12 incpaths = -Isrc/optcfg
nuclear@0 13
nuclear@0 14 CFLAGS = $(warn) $(dbg) $(opt) $(incpaths)
nuclear@0 15 CXXFLAGS = $(warn) $(dbg) $(opt) $(incpaths)
nuclear@0 16 LDFLAGS = -lGL -lGLEW -lX11 -lXext -lXcomposite -lm
nuclear@0 17
nuclear@0 18 $(bin): $(obj)
nuclear@0 19 $(CXX) -o $@ $(obj) $(LDFLAGS)
nuclear@0 20
nuclear@0 21 -include $(dep)
nuclear@0 22
nuclear@0 23 %.d: %.c
nuclear@0 24 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 25
nuclear@0 26 %.d: %.cc
nuclear@0 27 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 28
nuclear@0 29 .PHONY: clean
nuclear@0 30 clean:
nuclear@0 31 rm -f $(obj) $(bin)
nuclear@0 32
nuclear@0 33 .PHONY: cleandep
nuclear@0 34 cleandep:
nuclear@0 35 rm -f $(dep)
nuclear@0 36
nuclear@0 37 .PHONY: install
nuclear@0 38 install: $(bin)
nuclear@0 39 mkdir -p $(DESTDIR)$(PREFIX)/bin
nuclear@0 40 cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
nuclear@0 41
nuclear@0 42 .PHONY: uninstall
nuclear@0 43 uninstall:
nuclear@0 44 rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)