Revision 6915
Added by Aaron Marcuse-Kubitza about 12 years ago
common.Makefile | ||
---|---|---|
30 | 30 |
CP := cp -p |
31 | 31 |
cp = $(CP) $< $@ |
32 | 32 |
|
33 |
# File editing |
|
34 |
sudoAppend = echo $$'$(2)'|sudo tee -a $(1) >/dev/null |
|
35 |
|
|
33 | 36 |
# System |
34 | 37 |
os := $(shell uname) |
35 | 38 |
forOs = $(patsubst %,%-$(filter Linux Darwin,$(os)),$(1)) |
36 | 39 |
date = $(shell date +"%Y-%m-%d-%H-%M-%S") |
37 | 40 |
|
41 |
# Terminal |
|
42 |
esc := '[' |
|
43 |
reset := $(esc)'0m' |
|
44 |
emph := $(esc)'7m ' |
|
45 |
endEmph := ' '$(reset) |
|
46 |
|
|
47 |
# User interaction |
|
48 |
|
|
49 |
done = echo; echo $(emph)"Finished $@"$(endEmph); echo |
|
50 |
|
|
51 |
wait := read -p $(emph)'Press ENTER to continue:'$(endEmph) REPLY |
|
52 |
|
|
53 |
confirm = $(if $(shell read -p $(emph)"$(1)"$(endEmph)$$'$(if\ |
|
54 |
$(2),\n$(2))\nContinue? (y/n) ' REPLY; test "$$REPLY" = y && echo t),,\ |
|
55 |
$(error Aborting)) |
|
56 |
|
|
38 | 57 |
## SVN |
39 | 58 |
|
40 | 59 |
addFile = $(if $(wildcard $(1)),,touch $(1) && )svn add $(1) |
... | ... | |
59 | 78 |
localDirName := $(notdir $(realpath $(local))) |
60 | 79 |
remote := $(src_user)@$(src_server):/home/bien/svn/$(localDirName)/ |
61 | 80 |
|
81 |
# DB |
|
82 |
mkSchemaCmd = 'CREATE SCHEMA $(1);' |
|
83 |
rmSchemaCmd = 'DROP SCHEMA IF EXISTS "$(1)" CASCADE;' |
|
84 |
|
|
62 | 85 |
##### General targets |
63 | 86 |
|
64 | 87 |
all: # must be first target in Makefile, so add an empty version here |
Also available in: Unified diff
Makefiles: Factored out common vars/functions into lib/common.Makefile