xglcomp
diff Makefile @ 0:d9b3fba68705
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 21 Jan 2016 08:45:31 +0200 |
parents | |
children | b2b7cb950c28 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Makefile Thu Jan 21 08:45:31 2016 +0200 1.3 @@ -0,0 +1,44 @@ 1.4 +PREFIX = /usr/local 1.5 + 1.6 +ccsrc = $(wildcard src/*.cc) 1.7 +csrc = $(wildcard src/*.c) $(wildcard src/optcfg/*.c) 1.8 +obj = $(csrc:.c=.o) $(ccsrc:.cc=.o) 1.9 +dep = $(obj:.o=.d) 1.10 +bin = xglcomp 1.11 + 1.12 +warn = -pedantic -Wall 1.13 +dbg = -g 1.14 +opt = -O0 1.15 +incpaths = -Isrc/optcfg 1.16 + 1.17 +CFLAGS = $(warn) $(dbg) $(opt) $(incpaths) 1.18 +CXXFLAGS = $(warn) $(dbg) $(opt) $(incpaths) 1.19 +LDFLAGS = -lGL -lGLEW -lX11 -lXext -lXcomposite -lm 1.20 + 1.21 +$(bin): $(obj) 1.22 + $(CXX) -o $@ $(obj) $(LDFLAGS) 1.23 + 1.24 +-include $(dep) 1.25 + 1.26 +%.d: %.c 1.27 + @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.28 + 1.29 +%.d: %.cc 1.30 + @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@ 1.31 + 1.32 +.PHONY: clean 1.33 +clean: 1.34 + rm -f $(obj) $(bin) 1.35 + 1.36 +.PHONY: cleandep 1.37 +cleandep: 1.38 + rm -f $(dep) 1.39 + 1.40 +.PHONY: install 1.41 +install: $(bin) 1.42 + mkdir -p $(DESTDIR)$(PREFIX)/bin 1.43 + cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin) 1.44 + 1.45 +.PHONY: uninstall 1.46 +uninstall: 1.47 + rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)