(real_install): Create site-lisp in installation dir.
[bpt/emacs.git] / nt / makefile.nt
1 #
2 # Top level makefile for building GNU Emacs on Windows NT
3 #
4 # This file is part of GNU Emacs.
5 #
6 # GNU Emacs is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # GNU Emacs is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Emacs; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20 #
21 # Geoff Voelker (voelker@cs.washington.edu) 11-20-93
22 # 9-6-94
23 !include makefile.def
24
25 ALL = $(BLD)\addpm.exe $(BLD)\runemacs.exe
26 !if $(MSVCNT11)
27 TRES = $(BLD)\emacs.res
28 !else
29 TRES = $(BLD)\emacs.rbj
30 !endif
31
32 .c{$(BLD)}.obj:
33 $(CC) $(CFLAGS) -Fo$@ $<
34
35 addpm: $(BLD) $(BLD)\addpm.exe
36 $(BLD)\addpm.obj: addpm.c
37 $(BLD)\addpm.exe: $(BLD)\addpm.obj
38 $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \
39 $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib
40
41 #
42 # The resource file. NT 3.10 requires the use of cvtres; even though
43 # it is not necessary on later versions, it is still ok to use it.
44 #
45 $(TRES): emacs.rc
46 $(RC) -Fo$(BLD)\emacs.res $**
47 !if !$(MSVCNT11)
48 $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res
49 !endif
50
51 runemacs: $(BLD) $(BLD)\runemacs.exe
52 $(BLD)\runemacs.obj: runemacs.c
53 $(BLD)\runemacs.exe: $(BLD)\runemacs.obj $(TRES)
54 $(LINK) -out:$@ -subsystem:windows -entry:WinMainCRTStartup \
55 $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib
56
57 # Since Windows 95 does not support multiple commands on one command line
58 # (e.g., in for loops), we cannot use for loops any more.
59 # SUBDIRS = lib-src src lisp
60
61 #
62 # Build emacs
63 #
64 BUILD_CMD = $(MAKE) -f makefile.nt all
65 all: $(BLD) $(ALL)
66 cd ..\lib-src
67 $(BUILD_CMD)
68 cd ..\src
69 $(BUILD_CMD)
70 cd ..\lisp
71 $(BUILD_CMD)
72 cd ..\nt
73
74
75 emacs.bat: emacs.bat.in
76 echo @echo off > emacs.bat
77 echo REM !!! Warning: This file automatically generated !!! >> emacs.bat
78 echo set emacs_dir=$(INSTALL_DIR)>> emacs.bat
79 type emacs.bat.in >> emacs.bat
80
81 #
82 # Build and install emacs in INSTALL_DIR
83 #
84 INSTALL_CMD = $(MAKE) -f makefile.nt install
85 install: all emacs.bat
86 - mkdir $(INSTALL_DIR)
87 cd ..\lib-src
88 $(INSTALL_CMD)
89 cd ..\src
90 $(INSTALL_CMD)
91 cd ..\lisp
92 $(INSTALL_CMD)
93 cd ..\nt
94 - $(CP) emacs.bat $(INSTALL_DIR)\bin
95 - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin
96 - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin
97 - $(ADDPM) $(INSTALL_DIR)
98 - $(DEL) ..\same-dir.tst
99 - $(DEL) $(INSTALL_DIR)\same-dir.tst
100 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
101 if not exist ..\same-dir.tst $(MAKE) -f makefile.nt real_install
102 - $(DEL) ..\same-dir.tst
103 - $(DEL) $(INSTALL_DIR)\same-dir.tst
104
105 #
106 # This installs executables from ..\bin into the installation directory
107 # without building anything.
108 #
109 fast_install:
110 - mkdir $(INSTALL_DIR)\data
111 $(CP) ..\lib-src\DOC $(INSTALL_DIR)\etc
112 - mkdir $(INSTALL_DIR)\bin
113 - $(CP) emacs.bat $(INSTALL_DIR)\bin
114 - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin
115 - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin
116 - $(DEL) ..\same-dir.tst
117 - $(DEL) $(INSTALL_DIR)\same-dir.tst
118 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
119 if not exist ..\same-dir.tst $(CP) ..\bin\emacs.exe $(INSTALL_DIR)\bin
120 if not exist ..\same-dir.tst $(CP) ..\bin\etags.exe $(INSTALL_DIR)\bin
121 if not exist ..\same-dir.tst $(CP) ..\bin\ctags.exe $(INSTALL_DIR)\bin
122 if not exist ..\same-dir.tst nmake -f $(MAKE) real_install
123 - $(DEL) ..\same-dir.tst
124 - $(DEL) $(INSTALL_DIR)\same-dir.tst
125
126 real_install:
127 - $(DEL) ..\same-dir.tst
128 - $(DEL) $(INSTALL_DIR)\same-dir.tst
129 echo SameDirTest > $(INSTALL_DIR)\same-dir.tst
130 - mkdir $(INSTALL_DIR)\etc
131 - mkdir $(INSTALL_DIR)\info
132 - mkdir $(INSTALL_DIR)\lock
133 - mkdir $(INSTALL_DIR)\data
134 - mkdir $(INSTALL_DIR)\site-lisp
135 if not exist ..\same-dir.tst $(CP_DIR) ..\etc $(INSTALL_DIR)\etc
136 if not exist ..\same-dir.tst $(CP_DIR) ..\info $(INSTALL_DIR)\info
137 - $(DEL) ..\same-dir.tst
138 - $(DEL) $(INSTALL_DIR)\same-dir.tst
139
140 #
141 # Maintenance
142 #
143 CLEAN_CMD = $(MAKE) -f makefile.nt clean
144 clean:; - $(DEL) *~ *.pdb
145 - $(DEL_TREE) deleted
146 - $(DEL_TREE) $(OBJDIR)
147 - $(DEL_TREE) ..\bin
148 - $(DEL) ..\etc\DOC ..\etc\DOC-X
149 - $(DEL) emacs.bat
150 cd ..\lib-src
151 $(CLEAN_CMD)
152 cd ..\src
153 $(CLEAN_CMD)
154 cd ..\lisp
155 $(CLEAN_CMD)
156 cd ..\nt