-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.template
64 lines (44 loc) · 1.36 KB
/
lib.template
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
53
54
55
56
57
58
59
60
61
62
# Copyright (C) 2016 The Regents of the University of California
# Authored by David W. Shattuck, Ph.D.
ifndef MACHTYPE
$(error Please export the MACHTYPE variable before running makefile -- from the command line, type "export MACHTYPE")
endif
VersionNum = 16a1
Includes = $(LocalIncludes) -I$(BaseDir)include -I$(BaseDir)3rdParty/include
LongName = lib$(Name)$(VersionNum)_$(MACHTYPE).a
ShortName = lib$(Name)$(VersionNum).a
LibDir = $(BaseDir)lib/$(MACHTYPE)
CC := clang++ -O2 $(DEBUG) $(BUILDVERSION) -std=c++11
InstallCmd = install -d
Target = $(LibDir)/$(LongName)
ObjDir ?= $(BaseDir)obj/$(MACHTYPE)/$(Name)/
CCExtension = .cpp
SrcFiles := $(wildcard *$(CCExtension))
ObjFiles := $(addprefix $(ObjDir),$(SrcFiles:$(CCExtension)=.o))
all: DirCheck $(Target)
DirCheck: $(LibDir) $(ObjDir)
$(ObjDir):
$(InstallCmd) $(ObjDir)
echo Installing $(ObjDir)
$(ObjDir)%.o: %$(CCExtension)
$(CC) $(Includes) -c $< -o $@
install: $(ObjDir) $(Target)
$(LibDir):
$(InstallCmd) $(LibDir)
$(Target): $(LibDir) $(ObjFiles)
$(AR) r $(Target) $(ObjFiles) $(AuxObjs)
(cd $(LibDir); ln -f -s $(LongName) $(ShortName))
run:
link: deltarget $(Target)
deltarget:
rm -f $(Target)
depend:
makedepend -p$(ObjDir) -f makedep $(Includes) *$(CCExtension)
rm -f makedep.bak
clean:
rm -f $(ObjFiles)
distclean: clean
rm -f $(Target) makedep
makedep:
touch makedep
include makedep