1#
2# Makefile for GDB Stub for DJGPP/Mingw 0.3 source distribution
3#
4# Copyright 2000 by Jonathan Brogdon
5#
6
7include Makefile.cfg
8
9default:
10	@$(ECHO) Welcome to GDB Stub for DJGPP & Mingw 0.3 source distribution!
11	@$(ECHO) To make the GDB stub type:
12	@$(ECHO) 	make all		- Make library and demo programs
13	@$(ECHO) 	make library		- Make only library
14	@$(ECHO) 	make demo		- Make demo program
15	@$(ECHO) 	make install		- Install library and header files
16	@$(ECHO) 	make uninstall		- Uninstall library and header files
17	@$(ECHO) 	make clean		- Remove .o files
18	@$(ECHO) 	make distclean		- Remove ready binaries and .o files
19	@$(ECHO) 	make dep		- Make dependences
20
21# Inform make of phony targets
22.PHONY:	library demo clean blankdep dep distclean install
23
24all: dep library demo
25	@$(ECHO) Library and demo program created
26
27./lib/libgdbst.a:
28	@mkdir -p lib
29	@make -s -C ./src/library all
30
31library: ./lib/libgdbst.a
32	@$(ECHO) Library created
33
34demo: ./lib/libgdbst.a
35	@mkdir -p demo
36	@make -s -C ./src/demo all
37	@$(ECHO) Demo program created
38
39clean:
40	@make -s -C ./src/library clean
41	@make -s -C ./src/demo clean
42	@$(ECHO) Clean complete
43
44blankdep:
45# Create blank depend.dep files to avoid errors
46	@$(ECHOBLANK) > ./src/library/depend.dep
47	@$(ECHOBLANK) > ./src/demo/depend.dep
48
49# Now carry on as usual
50dep:	blankdep
51	@make -s -C ./src/library dep
52	@make -s -C ./src/demo dep
53	@$(ECHO) Created dependency files
54
55# Blank all the dependencies too
56distclean:	blankdep
57	@make -s -C ./src/library distclean
58	@make -s -C ./src/demo distclean
59	@$(RM) -r ./demo/
60	@$(RM) -r ./lib/
61	@$(ECHO) Cleaned up files
62
63install: library
64ifdef DJGPP
65	@cp lib/*.a $(DJDIR)/lib
66	@ginstall -d $(DJDIR)/include
67	@cp include/*.h $(DJDIR)/include
68	@$(ECHO) GDB Stub Library for DJGPP installed
69endif
70
71uninstall:
72ifdef DJGPP
73	@$(RM) $(DJDIR)/lib/libgdb.a
74	@$(RM) $(DJDIR)/include/i386-stub.h
75	@$(ECHO) GDB Stub Library for DJGPP uninstalled
76ifdef DJGPP
77
78
79
80
81
82
83
84