miniassimp

annotate Makefile @ 0:879c81d94345

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 28 Jan 2019 18:19:26 +0200
parents
children
rev   line source
nuclear@0 1 src = $(wildcard src/*.cpp)
nuclear@0 2 obj = $(src:.cpp=.o)
nuclear@0 3 dep = $(obj:.o=.d)
nuclear@0 4
nuclear@0 5 name = miniassimp
nuclear@0 6 so_major = 0
nuclear@0 7 so_minor = 1
nuclear@0 8
nuclear@0 9 liba = lib$(name).a
nuclear@0 10 libso = lib$(name).so
nuclear@0 11 ldname = lib$(name).so.$(so_major)
nuclear@0 12 soname = lib$(name).so.$(so_major).$(so_minor)
nuclear@0 13
nuclear@0 14 warn = -pedantic -Wall
nuclear@0 15 dbg = -g
nuclear@0 16 opt = -O0
nuclear@0 17 inc = -Iinclude
nuclear@0 18
nuclear@0 19 CC=gcc
nuclear@0 20 CXX=g++
nuclear@0 21 CFLAGS = $(warn) $(dbg) $(opt) $(def) $(inc)
nuclear@0 22 CXXFLAGS = $(warn) $(dbg) $(opt) $(def) $(inc)
nuclear@0 23
nuclear@0 24 shared = -shared -Wl,-soname,$(soname)
nuclear@0 25
nuclear@0 26 .PHONY: all
nuclear@0 27 all: $(libso) $(liba)
nuclear@0 28
nuclear@0 29 $(liba): $(obj)
nuclear@0 30 $(AR) rcs $@ $(obj)
nuclear@0 31
nuclear@0 32 $(libso): $(obj)
nuclear@0 33 $(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
nuclear@0 34
nuclear@0 35 -include $(dep)
nuclear@0 36
nuclear@0 37 %.d: %.cpp
nuclear@0 38 @echo depfile $@
nuclear@0 39 @$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
nuclear@0 40
nuclear@0 41 .PHONY: clean
nuclear@0 42 clean:
nuclear@0 43 rm -f $(obj) $(liba) $(libso)