summaryrefslogtreecommitdiff
path: root/NWGNUhead.inc
blob: 55e3be56f9c7aeff97c03f375f608d6b6825032a (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# Obtain the global build environment
#

include $(AP_WORK)\NWGNUenvironment.inc

#
# If an NWGNUmake.inc file exists in the current directory, bring it in.
#

ifeq "$(wildcard NWGNUmake.inc)" "NWGNUmake.inc"
include NWGNUmake.inc
endif

#
# Define base targets and rules
# 

TARGETS = libs nlms install clobber_libs clobber_nlms clean

.PHONY : $(TARGETS) default all help

default: $(SUBDIRS) libs nlms

all: $(SUBDIRS) libs nlms install

help :
	@echo targets for RELEASE=$(RELEASE):
	@echo (default) . . . . libs nlms
	@echo all . . . . . . . does everything (libs nlms install)
	@echo libs. . . . . . . builds all libs
	@echo nlms. . . . . . . builds all nlms
	@echo install . . . . . builds libs and nlms and copies install files to
	@echo                   "$(INSTALL)"
	@echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map
	@echo clobber_all . . . deletes all possible output from the make
	@echo clobber_install . deletes all files in $(INSTALL)
	@$(CMD) echo.
	@echo Multiple targets can be used on a single nmake command line -
	@echo (i.e. $(MAKE) clean all)
	@$(CMD) echo.
	@echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=optimized
	@echo The default is RELEASE=optimized

clobber_all :: clean clobber_install

clobber_install ::
	-$(DELTREE) $(INSTALL) 2>NUL

$(TARGETS) :: $(SUBDIRS)

install :: nlms $(INSTDIRS)

$(INSTDIRS) :
	@echo creating $@
	$(CHKNOT) $@\NUL mkdir $@

#
# build recursive targets
#

$(SUBDIRS) : FORCE
ifneq "$(MAKECMDGOALS)" "clean"
	@echo Building $(CURDIR)/$@
endif
	$(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE)
	$(CMD) echo.

FORCE:

#
# Standard targets
#

clean ::
	@echo Cleaning up $(CURDIR)
	-$(DELTREE) $(OBJDIR) 2> NUL
	$(CHK) *.err $(DEL) *.err
	$(CHK) *.map $(DEL) *.map
	$(CHK) *.d $(DEL) *.d
	$(CHK) *.tmp $(DEL) *.tmp
	$(CHK) *.sym $(DEL) *.sym
	-$(DELTREE) $(OBJDIR) 2> NUL

$(OBJDIR) ::
	$(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR)