Makefile 1.08 KB
Newer Older
1
2
3
4
# Code to see if ~/.gdbinit already exists

AUTO_LOAD_FOUND := $(shell grep -s -e "^[ \t]*set auto-load safe-path /" ~/.gdbinit | wc -l)
AUTO_SCRIPTS_FOUND := $(shell grep -s -e "^[ \t]*set auto-load python-scripts on" ~/.gdbinit | wc -l)
5
6
7

.PHONY: all
all :
rdubner's avatar
rdubner committed
8
## Make sure the VERSION text in cprint.py is up-to-date
9
	./version.sh
10
11
12
13
14
15
16

.PHONY: pregit
pregit:
	dos2unix cprint.py
	dos2unix Makefile
	dos2unix .gitignore

17
18
19
20
21
22
23
24
#
# As of this writing, cprint.py is being embedded into the COBOL executables.
# By default, gdb doesn't put the current working directory onto the list 
# of safe auto-load directories.  There is a default safe directory, but that
# directory isn't on the search path.  So, one way or the other, the user's 
# .gdbinit file has to be modified.	 I have chosen to defeat the default 
# security setting to allow auto-load from anywhere.
#
25
26
.PHONY : install
install :
27
28
	mkdir -p /usr/local/bin/
	cp cprint.py /usr/local/bin/
29
30
31
32
33
34
35
ifeq ($(AUTO_LOAD_FOUND), 0)
	echo "set auto-load safe-path /" >>~/.gdbinit
endif
ifeq ($(AUTO_SCRIPTS_FOUND), 0)
	echo "set auto-load python-scripts on" >>~/.gdbinit
endif