| 1 | # $Id: makefile,v 1.88 2003-04-14 23:08:52 bird Exp $
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #
 | 
|---|
| 4 | # Odin32 API
 | 
|---|
| 5 | #
 | 
|---|
| 6 | #       Top of the src tree makefile
 | 
|---|
| 7 | #
 | 
|---|
| 8 | #
 | 
|---|
| 9 | #       Usage: nmake ( all | libs | dep | clean )
 | 
|---|
| 10 | #
 | 
|---|
| 11 | #            all: Build the entire src tree.
 | 
|---|
| 12 | #            lib: Builds the libraries.
 | 
|---|
| 13 | #            dep: Builds depenency information for the entire src tree.
 | 
|---|
| 14 | #            clean: Bring src tree back to a "virgin" state.
 | 
|---|
| 15 | #
 | 
|---|
| 16 | #
 | 
|---|
| 17 | #
 | 
|---|
| 18 | 
 | 
|---|
| 19 | 
 | 
|---|
| 20 | #
 | 
|---|
| 21 | # Build environment.
 | 
|---|
| 22 | #
 | 
|---|
| 23 | !include ../makefile.inc
 | 
|---|
| 24 | 
 | 
|---|
| 25 | 
 | 
|---|
| 26 | #
 | 
|---|
| 27 | # Exclude lists which is to be passed in to DOWITHDIRS
 | 
|---|
| 28 | #
 | 
|---|
| 29 | NOTTOBEMADE = CVS;pe2lx;odin32api;odinwps;spy;odinldr;ws2help;win16ldr;oslib;custombuild;opengl;programs;crtdll;msvcrt   # generally not made
 | 
|---|
| 30 | NOTDLLS     = $(NOTTOBEMADE);peldr;dllentry;guidlib     # not dlls
 | 
|---|
| 31 | NOTHAVELIBS = $(NOTTOBEMADE);peldr                      # don't generate libs
 | 
|---|
| 32 | NOTWIN32DLLS= $(NOTDLLS);win32k;odincrt;dllentry        # not win32 dlls.
 | 
|---|
| 33 | 
 | 
|---|
| 34 | 
 | 
|---|
| 35 | #
 | 
|---|
| 36 | # Check for SMP and MASSIVE.
 | 
|---|
| 37 | #   SMP:        Working backwards thru the directories traversed by a rule.
 | 
|---|
| 38 | #   MASSIVE:    Spawn a child processes for each process.
 | 
|---|
| 39 | #
 | 
|---|
| 40 | EXTRA =
 | 
|---|
| 41 | !ifdef SMP
 | 
|---|
| 42 | EXTRA = -r
 | 
|---|
| 43 | !endif
 | 
|---|
| 44 | !ifdef MASSIVE
 | 
|---|
| 45 | EXTRA = -s start "Odin32 Massive Build" /B /C
 | 
|---|
| 46 | !endif
 | 
|---|
| 47 | # TEMPORARY: ignore return codes while we're working with watcom and nmake.
 | 
|---|
| 48 | !if defined(WAT) && defined(NMAKE)
 | 
|---|
| 49 | EXTRA = $(EXTRA) -i
 | 
|---|
| 50 | !endif
 | 
|---|
| 51 | 
 | 
|---|
| 52 | 
 | 
|---|
| 53 | #
 | 
|---|
| 54 | # All rule. Make libraries and then build every directory.
 | 
|---|
| 55 | #
 | 
|---|
| 56 | all: libs build
 | 
|---|
| 57 | 
 | 
|---|
| 58 | 
 | 
|---|
| 59 | 
 | 
|---|
| 60 | #
 | 
|---|
| 61 | # Smp rule - Dual build. Starts a second build process after libraries
 | 
|---|
| 62 | #            was made.
 | 
|---|
| 63 | #
 | 
|---|
| 64 | smp: startsmp libs build
 | 
|---|
| 65 | 
 | 
|---|
| 66 | startsmp:   # Internal helper for the smp rule.
 | 
|---|
| 67 |     start "Odin32 SMP Build Process" /B $(MAKE_CMD) SMP=1 libs build
 | 
|---|
| 68 | 
 | 
|---|
| 69 | 
 | 
|---|
| 70 | #
 | 
|---|
| 71 | # Rules which supports the SMP and MASSIVE features.
 | 
|---|
| 72 | #
 | 
|---|
| 73 | # build:    Invokes the all rule in every directory.
 | 
|---|
| 74 | # clean:    Invokes the clean rule in every directory.
 | 
|---|
| 75 | # lib(s):   Invokes the lib rule in every directory known to support it.
 | 
|---|
| 76 | # dep:      Invokes the dep rule in every directory.
 | 
|---|
| 77 | #
 | 
|---|
| 78 | build:
 | 
|---|
| 79 |     @$(DOWITHDIRS) -e$(NOTTOBEMADE) -lbld$(CCENV)$(DEBUG) -c $(EXTRA) \
 | 
|---|
| 80 |         $(MAKE_CMD) all
 | 
|---|
| 81 | 
 | 
|---|
| 82 | lib libs:
 | 
|---|
| 83 |     @$(DOWITHDIRS) -e$(NOTHAVELIBS) -c -llib$(CCENV)$(DEBUG) $(EXTRA) \
 | 
|---|
| 84 |         $(MAKE_CMD) lib
 | 
|---|
| 85 | 
 | 
|---|
| 86 | dep:
 | 
|---|
| 87 |     @$(DOWITHDIRS) -e$(NOTTOBEMADE) -c -ldep $(EXTRA) \
 | 
|---|
| 88 |         $(CMDQD_SUB) $(MAKE_CMD) NODEP=1 dep
 | 
|---|
| 89 |     $(CMDQD_WAIT)
 | 
|---|
| 90 | 
 | 
|---|
| 91 | clean cleanall:
 | 
|---|
| 92 |     @$(DOWITHDIRS) -e$(NOTTOBEMADE) -c -lcln$(CCENV)$(DEBUG) $(EXTRA) \
 | 
|---|
| 93 |         $(CMDQD_SUB)  $(MAKE_CMD) NODEP=1 $@
 | 
|---|
| 94 |     $(CMDQD_WAIT)
 | 
|---|
| 95 | 
 | 
|---|
| 96 | $(COMMONRULES:cleanall clean dep lib all=):
 | 
|---|
| 97 |     @$(DOWITHDIRS) -e$(NOTTOBEMADE) -c -l$@$(CCENV)$(DEBUG) $(EXTRA) \
 | 
|---|
| 98 |         $(MAKE_CMD) $@
 | 
|---|
| 99 | 
 | 
|---|
| 100 | #
 | 
|---|
| 101 | # Custom rules
 | 
|---|
| 102 | #
 | 
|---|
| 103 | CUSTOMBUILD = kernel32 user32 advapi32 comctl32 comdlg32 ctl3d32 ddraw ddraw \
 | 
|---|
| 104 |     dinput gdi32 icmp imagehlp iphlpapi lz32 msvfw32 ntdll ole32 riched32 \
 | 
|---|
| 105 |     rpcrt4 shell32 shlwapi version wininet winmm winspool wnaspi32 ws2_32 \
 | 
|---|
| 106 |     wsock32 uxtheme imm32
 | 
|---|
| 107 | 
 | 
|---|
| 108 | custombuild:
 | 
|---|
| 109 |     @$(DODIRS) "$(CUSTOMBUILD)" $(MAKE_CMD) all CUSTOMBUILD=1
 | 
|---|
| 110 |     @$(DODIRS) ".\win32k\lib custombuild" $(MAKE_CMD) all
 | 
|---|
| 111 | 
 | 
|---|
| 112 | custombuild_all custombuild_clean custombuild_dep:
 | 
|---|
| 113 |     @$(DODIRS) "$(CUSTOMBUILD)" $(MAKE_CMD) $(@:custombuild_=) CUSTOMBUILD=1
 | 
|---|
| 114 |     @$(DODIRS) ".\win32k\lib custombuild" $(MAKE_CMD) $(@:custombuild_=)
 | 
|---|
| 115 | 
 | 
|---|
| 116 | 
 | 
|---|
| 117 | #
 | 
|---|
| 118 | # Odin32 API DB Management
 | 
|---|
| 119 | #
 | 
|---|
| 120 | APIImport:
 | 
|---|
| 121 |     @$(DOWITHDIRS) -e$(NOTWIN32DLLS) -cp \
 | 
|---|
| 122 |         ..\..\tools\bin\APIImport.cmd
 | 
|---|
| 123 | 
 | 
|---|
| 124 | StateUpd:
 | 
|---|
| 125 |     ..\tools\bin\StateUpd.exe -io+
 | 
|---|
| 126 |     -@$(DOWITHDIRS) -e$(NOTWIN32DLLS) -cp -i \
 | 
|---|
| 127 |         ..\..\tools\bin\StateUpd.cmd -ie- -ib-
 | 
|---|
| 128 |     @$(DODIRS) ".\win32k" $(MAKE_CMD) StateUpd
 | 
|---|
| 129 |     ..\tools\bin\StateUpd.exe -io+
 | 
|---|
| 130 | 
 | 
|---|
| 131 | ReadSignals:
 | 
|---|
| 132 |     -@$(DOWITHDIRS) -e$(NOTWIN32DLLS:win32k;=) -cp -i \
 | 
|---|
| 133 |         IF EXIST signals.log list signals.log
 | 
|---|
| 134 | 
 | 
|---|
| 135 | ReadStateUpdLogs:
 | 
|---|
| 136 |     -@$(DOWITHDIRS) -e$(NOTWIN32DLLS:win32k;=) -cp -i \
 | 
|---|
| 137 |         IF EXIST stateupd.log list stateupd.log
 | 
|---|
| 138 | 
 | 
|---|
| 139 | ReadAPIImportLogs:
 | 
|---|
| 140 |     -@$(DOWITHDIRS) -e$(NOTWIN32DLLS) -cp -i \
 | 
|---|
| 141 |         IF EXIST apiimport.log list apiimport.log
 | 
|---|
| 142 | 
 | 
|---|
| 143 | CleanDBLogs:
 | 
|---|
| 144 |     @$(DOWITHDIRS) -e$(NOTWIN32DLLS:win32k;=) -cp \
 | 
|---|
| 145 |         $(RM) apiimport.log signals.log stateupd.log apiimport.def
 | 
|---|
| 146 |     $(RM) signals.log stateupd.log
 | 
|---|
| 147 | 
 | 
|---|
| 148 | 
 | 
|---|
| 149 | !ifdef NMAKE
 | 
|---|
| 150 | #
 | 
|---|
| 151 | # Common: If MULTIJOBS is defined make sure cmdqd is running.
 | 
|---|
| 152 | #
 | 
|---|
| 153 | !ifndef NO_MULTIJOBS
 | 
|---|
| 154 | !   ifdef MULTIJOBS
 | 
|---|
| 155 | !      if [$(CMDQD) queryrunning] != 0
 | 
|---|
| 156 | !          if [$(DODIRS) "$(ODIN32_BASE)\tools\cmdqd" $(MAKE_CMD) all] == 0
 | 
|---|
| 157 | !          endif
 | 
|---|
| 158 | !          if [$(CMDQD) init 7] == 0
 | 
|---|
| 159 | !          endif
 | 
|---|
| 160 | !      endif
 | 
|---|
| 161 | !   endif
 | 
|---|
| 162 | !endif
 | 
|---|
| 163 | !endif
 | 
|---|
| 164 | 
 | 
|---|