1 # Makefile for GNU Emacs on the Microsoft W32 API.
2 # Copyright (c) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3 # Tim Fleehart (apollo@online.com) 17-Apr-92
4 # Geoff Voelker (voelker@cs.washington.edu) 11-20-93
6 # This file is part of GNU Emacs.
8 # GNU Emacs is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # GNU Emacs is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Emacs; see the file COPYING. If not, write to the
20 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 # Boston, MA 02111-1307, USA.
25 # Sets up the system dependent macros.
27 !include ..\nt\makefile.def
32 # HAVE_CONFIG_H is required by some generic gnu sources stuck into
33 # the emacs source tree.
35 LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc
37 EMACS = $(BLD)\emacs.exe
38 TEMACS = $(BLD)\temacs.exe
39 TLIB1 = $(BLD)\temacs1.lib
40 TLIB2 = $(BLD)\temacs2.lib
42 TLIBW32 = $(BLD)\temacw32.lib
46 TOBJ = $(BLD)\emacs.obj
48 TRES = $(BLD)\emacs.res
50 TRES = $(BLD)\emacs.rbj
52 TLASTLIB = $(BLD)\lastfile.lib
54 # see comments in allocate_heap in w32heap.c before changing any of the
55 # -stack, -heap, or -base settings.
56 LINK_FLAGS = $(ARCH_LDFLAGS) -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -debugtype:cv -machine:$(ARCH) -subsystem:$(SUBSYSTEM) -entry:_start -map:$(BLD)\temacs.map
59 # Split up the objects into two sets so that we don't run out of
60 # command line space when we link them into a library.
62 OBJ1 = $(BLD)\abbrev.obj \
69 $(BLD)\casefiddle.obj \
93 OBJ2 = $(BLD)\w32.obj \
97 $(BLD)\w32console.obj \
113 $(BLD)\floatfns.obj \
116 $(BLD)\intervals.obj \
118 $(BLD)\textprop.obj \
119 $(BLD)\vm-limit.obj \
120 $(BLD)\region-cache.obj \
121 $(BLD)\strftime.obj \
124 $(BLD)\category.obj \
128 WIN32OBJ = $(BLD)\w32term.obj \
131 $(BLD)\w32faces.obj \
132 $(BLD)\w32select.obj \
153 # Build the executable and dump it.
158 # Headers we would preprocess if we could.
160 PREPARED_HEADERS = config.h paths.h
161 config.h: ..\nt\$(CONFIG_H)
163 paths.h: ..\nt\paths.h
167 # Make sure we have the DOC file in the right place.
169 DOC = $(OBJDIR)\etc\DOC-X
170 $(DOC):; cd ..\lib-src
172 $(MAKE) -f makefile.nt all
176 # The dumped executable
179 $(EMACS): $(PREPARED_HEADERS) $(DOC) $(TEMACS)
181 temacs.exe -batch -l loadup dump
185 # The undumped executable
187 temacs: $(BLD) $(TEMACS)
188 $(TEMACS): $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES)
189 $(LINK) -out:$(TEMACS) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS)
192 # The resource file. NT 3.10 requires the use of cvtres; even though
193 # it is not necessary on later versions, it is still ok to use it.
195 $(TRES): ..\nt\emacs.rc
196 $(RC) -i..\nt -Fo$(BLD)\emacs.res $**
198 $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res
202 # Build the library. Split up the build into two phases...otherwise we
203 # run out of command line space.
210 $(TLIBW32): $(WIN32OBJ)
215 # Place lastfile.obj in its own library so that it can be loaded after
216 # the source libraries but before any system libraries. Doing so defines
217 # the end of Emacs' data section portably across compilers and systems.
219 $(TLASTLIB): $(BLD)\lastfile.obj
226 $(CC) $(CFLAGS) -Fo$@ $<
229 # Assuming INSTALL_DIR is defined, build and install emacs in it.
232 - mkdir $(INSTALL_DIR)\bin
233 $(CP) $(EMACS) $(INSTALL_DIR)\bin
238 clean:; - $(DEL) *~ *.pdb config.h paths.h
239 - $(DEL_TREE) deleted
240 - $(DEL_TREE) $(OBJDIR)
243 # These files are the ones that compile conditionally on CANNOT_DUMP...
244 # this target is mostly used for debugging.
246 cleandump:; cd $(BLD)
247 - $(DEL) callproc.obj data.obj dispnew.obj doc.obj editfns.obj emacs.obj lread.obj process.obj sysdep.obj term.obj w32heap.obj unexw32.obj
256 $(BLD)\abbrev.obj : \
258 $(EMACS_ROOT)\src\s\ms-w32.h \
259 $(EMACS_ROOT)\src\m\intel386.h \
260 $(EMACS_ROOT)\src\config.h \
268 $(EMACS_ROOT)\src\s\ms-w32.h \
269 $(EMACS_ROOT)\src\m\intel386.h \
270 $(EMACS_ROOT)\src\config.h \
272 $(SRC)\dispextern.h \
278 $(SRC)\blockinput.h \
281 $(BLD)\alloca.obj : \
283 $(EMACS_ROOT)\src\s\ms-w32.h \
284 $(EMACS_ROOT)\src\m\intel386.h \
285 $(EMACS_ROOT)\src\config.h \
287 $(SRC)\m\intel386.h \
291 $(BLD)\buffer.obj : \
293 $(EMACS_ROOT)\nt\inc\sys\param.h \
294 $(EMACS_ROOT)\src\s\ms-w32.h \
295 $(EMACS_ROOT)\src\m\intel386.h \
296 $(EMACS_ROOT)\src\config.h \
298 $(SRC)\dispextern.h \
304 $(SRC)\blockinput.h \
305 $(SRC)\region-cache.h
307 $(BLD)\bytecode.obj : \
313 $(BLD)\callint.obj : \
322 $(BLD)\callproc.obj : \
324 $(EMACS_ROOT)\src\s\ms-w32.h \
325 $(EMACS_ROOT)\src\m\intel386.h \
326 $(EMACS_ROOT)\src\config.h \
328 $(EMACS_ROOT)\nt\inc\sys\param.h \
334 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
335 $(EMACS_ROOT)\nt\inc\sys\file.h \
338 $(BLD)\casefiddle.obj : \
339 $(SRC)\casefiddle.c \
340 $(EMACS_ROOT)\src\s\ms-w32.h \
341 $(EMACS_ROOT)\src\m\intel386.h \
342 $(EMACS_ROOT)\src\config.h \
347 $(CC) $(CFLAGS) -Fo$@ casefiddle.c
349 $(BLD)\casetab.obj : \
351 $(EMACS_ROOT)\src\s\ms-w32.h \
352 $(EMACS_ROOT)\src\m\intel386.h \
353 $(EMACS_ROOT)\src\config.h \
359 $(EMACS_ROOT)\src\s\ms-w32.h \
360 $(EMACS_ROOT)\src\m\intel386.h \
361 $(EMACS_ROOT)\src\config.h \
367 $(EMACS_ROOT)\src\s\ms-w32.h \
368 $(EMACS_ROOT)\src\m\intel386.h \
369 $(EMACS_ROOT)\src\config.h \
377 $(EMACS_ROOT)\src\s\ms-w32.h \
378 $(EMACS_ROOT)\src\m\intel386.h \
379 $(EMACS_ROOT)\src\config.h \
387 $(EMACS_ROOT)\src\s\ms-w32.h \
388 $(EMACS_ROOT)\src\m\intel386.h \
389 $(EMACS_ROOT)\src\config.h \
397 $(BLD)\dispnew.obj : \
399 $(EMACS_ROOT)\src\s\ms-w32.h \
400 $(EMACS_ROOT)\src\m\intel386.h \
401 $(EMACS_ROOT)\src\config.h \
413 $(SRC)\dispextern.h \
415 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
416 $(EMACS_ROOT)\nt\inc\sys\file.h \
425 $(EMACS_ROOT)\src\s\ms-w32.h \
426 $(EMACS_ROOT)\src\m\intel386.h \
427 $(EMACS_ROOT)\src\config.h \
428 $(EMACS_ROOT)\nt\inc\sys\file.h \
433 $(BLD)\doprnt.obj : \
435 $(EMACS_ROOT)\src\s\ms-w32.h \
436 $(EMACS_ROOT)\src\m\intel386.h \
437 $(EMACS_ROOT)\src\config.h
439 $(BLD)\dosfns.obj : \
441 $(EMACS_ROOT)\src\s\ms-w32.h \
442 $(EMACS_ROOT)\src\m\intel386.h \
443 $(EMACS_ROOT)\src\config.h \
452 $(BLD)\editfns.obj : \
454 $(EMACS_ROOT)\src\s\ms-w32.h \
455 $(EMACS_ROOT)\src\m\intel386.h \
456 $(EMACS_ROOT)\src\config.h \
459 $(EMACS_ROOT)\nt\inc\pwd.h \
461 $(SRC)\dispextern.h \
470 $(EMACS_ROOT)\src\s\ms-w32.h \
471 $(EMACS_ROOT)\src\m\intel386.h \
472 $(EMACS_ROOT)\src\config.h \
475 $(SRC)\dispextern.h \
477 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
478 $(EMACS_ROOT)\nt\inc\sys\file.h \
485 $(EMACS_ROOT)\src\s\ms-w32.h \
486 $(EMACS_ROOT)\src\m\intel386.h \
487 $(EMACS_ROOT)\src\config.h \
489 $(SRC)\blockinput.h \
493 $(BLD)\fileio.obj : \
495 $(EMACS_ROOT)\src\s\ms-w32.h \
496 $(EMACS_ROOT)\src\m\intel386.h \
497 $(EMACS_ROOT)\src\config.h \
500 $(EMACS_ROOT)\nt\inc\pwd.h \
502 $(EMACS_ROOT)\nt\inc\sys\param.h \
505 $(SRC)\dispextern.h \
509 $(EMACS_ROOT)\nt\inc\sys\file.h \
513 $(BLD)\filelock.obj : \
515 $(EMACS_ROOT)\src\s\ms-w32.h \
516 $(EMACS_ROOT)\src\m\intel386.h \
517 $(EMACS_ROOT)\src\config.h \
520 $(EMACS_ROOT)\nt\inc\pwd.h \
521 $(EMACS_ROOT)\nt\inc\sys\file.h \
523 $(EMACS_ROOT)\src\paths.h \
528 $(BLD)\filemode.obj : \
530 $(EMACS_ROOT)\src\s\ms-w32.h \
531 $(EMACS_ROOT)\src\m\intel386.h \
532 $(EMACS_ROOT)\src\config.h \
534 $(SRC)\m\intel386.h \
537 $(BLD)\floatfns.obj : \
539 $(EMACS_ROOT)\src\s\ms-w32.h \
540 $(EMACS_ROOT)\src\m\intel386.h \
541 $(EMACS_ROOT)\src\config.h \
547 $(EMACS_ROOT)\src\s\ms-w32.h \
548 $(EMACS_ROOT)\src\m\intel386.h \
549 $(EMACS_ROOT)\src\config.h \
554 $(SRC)\dispextern.h \
559 $(EMACS_ROOT)\src\s\ms-w32.h \
560 $(EMACS_ROOT)\src\m\intel386.h \
561 $(EMACS_ROOT)\src\config.h \
570 $(BLD)\getloadavg.obj : \
571 $(SRC)\getloadavg.c \
572 $(EMACS_ROOT)\nt\inc\sys\param.h \
573 $(EMACS_ROOT)\src\s\ms-w32.h \
574 $(EMACS_ROOT)\src\m\intel386.h \
575 $(EMACS_ROOT)\src\config.h \
577 $(SRC)\m\intel386.h \
579 $(EMACS_ROOT)\nt\inc\sys\file.h
581 $(BLD)\gmalloc.obj : \
583 $(EMACS_ROOT)\src\s\ms-w32.h \
584 $(EMACS_ROOT)\src\m\intel386.h \
585 $(EMACS_ROOT)\src\config.h \
586 $(EMACS_ROOT)\nt\inc\sys\param.h \
588 $(CC) $(CFLAGS) -D__STDC__ -Fo$@ gmalloc.c
590 $(BLD)\hftctl.obj : \
592 $(EMACS_ROOT)\src\s\ms-w32.h \
593 $(EMACS_ROOT)\src\m\intel386.h \
594 $(EMACS_ROOT)\src\config.h \
595 $(EMACS_ROOT)\nt\inc\sys\ioctl.h
597 $(BLD)\indent.obj : \
599 $(EMACS_ROOT)\src\s\ms-w32.h \
600 $(EMACS_ROOT)\src\m\intel386.h \
601 $(EMACS_ROOT)\src\config.h \
610 $(SRC)\dispextern.h \
612 $(SRC)\region-cache.h
614 $(BLD)\insdel.obj : \
616 $(EMACS_ROOT)\src\s\ms-w32.h \
617 $(EMACS_ROOT)\src\m\intel386.h \
618 $(EMACS_ROOT)\src\config.h \
620 $(SRC)\dispextern.h \
626 $(BLD)\intervals.obj : \
628 $(EMACS_ROOT)\src\s\ms-w32.h \
629 $(EMACS_ROOT)\src\m\intel386.h \
630 $(EMACS_ROOT)\src\config.h \
632 $(SRC)\dispextern.h \
636 $(CC) $(CFLAGS) -Fo$@ intervals.c
638 $(BLD)\keyboard.obj : \
640 $(EMACS_ROOT)\src\s\ms-w32.h \
641 $(EMACS_ROOT)\src\m\intel386.h \
642 $(EMACS_ROOT)\src\config.h \
654 $(SRC)\dispextern.h \
656 $(SRC)\blockinput.h \
659 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
660 $(EMACS_ROOT)\nt\inc\sys\file.h \
667 $(BLD)\keymap.obj : \
669 $(EMACS_ROOT)\src\s\ms-w32.h \
670 $(EMACS_ROOT)\src\m\intel386.h \
671 $(EMACS_ROOT)\src\config.h \
679 $(BLD)\lastfile.obj : \
684 $(EMACS_ROOT)\src\s\ms-w32.h \
685 $(EMACS_ROOT)\src\m\intel386.h \
686 $(EMACS_ROOT)\src\config.h \
687 $(EMACS_ROOT)\nt\inc\sys\file.h \
690 $(EMACS_ROOT)\src\paths.h \
696 $(BLD)\macros.obj : \
698 $(EMACS_ROOT)\src\s\ms-w32.h \
699 $(EMACS_ROOT)\src\m\intel386.h \
700 $(EMACS_ROOT)\src\config.h \
707 $(BLD)\marker.obj : \
709 $(EMACS_ROOT)\src\s\ms-w32.h \
710 $(EMACS_ROOT)\src\m\intel386.h \
711 $(EMACS_ROOT)\src\config.h \
715 $(BLD)\minibuf.obj : \
717 $(EMACS_ROOT)\src\s\ms-w32.h \
718 $(EMACS_ROOT)\src\m\intel386.h \
719 $(EMACS_ROOT)\src\config.h \
723 $(SRC)\dispextern.h \
728 $(BLD)\mocklisp.obj : \
730 $(EMACS_ROOT)\src\s\ms-w32.h \
731 $(EMACS_ROOT)\src\m\intel386.h \
732 $(EMACS_ROOT)\src\config.h \
740 $(SRC)\m\intel386.h \
743 $(EMACS_ROOT)\nt\inc\pwd.h \
746 $(BLD)\w32heap.obj : \
750 $(BLD)\w32inevt.obj : \
753 $(SRC)\m\intel386.h \
757 $(SRC)\blockinput.h \
760 $(BLD)\w32proc.obj : \
763 $(SRC)\m\intel386.h \
770 $(BLD)\w32console.obj : \
771 $(SRC)\w32console.c \
773 $(SRC)\m\intel386.h \
781 $(BLD)\prefix-args.obj : \
786 $(EMACS_ROOT)\src\s\ms-w32.h \
787 $(EMACS_ROOT)\src\m\intel386.h \
788 $(EMACS_ROOT)\src\config.h \
795 $(SRC)\dispextern.h \
798 $(BLD)\process.obj : \
800 $(EMACS_ROOT)\src\s\ms-w32.h \
801 $(EMACS_ROOT)\src\m\intel386.h \
802 $(EMACS_ROOT)\src\config.h \
803 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
804 $(EMACS_ROOT)\nt\inc\sys\file.h \
820 $(BLD)\ralloc.obj : \
822 $(EMACS_ROOT)\src\s\ms-w32.h \
823 $(EMACS_ROOT)\src\m\intel386.h \
824 $(EMACS_ROOT)\src\config.h \
827 $(SRC)\m\intel386.h \
829 $(EMACS_ROOT)\nt\inc\sys\param.h \
834 $(EMACS_ROOT)\src\s\ms-w32.h \
835 $(EMACS_ROOT)\src\m\intel386.h \
836 $(EMACS_ROOT)\src\config.h \
838 $(SRC)\m\intel386.h \
845 $(BLD)\region-cache.obj : \
846 $(SRC)\region-cache.c \
847 $(EMACS_ROOT)\src\s\ms-w32.h \
848 $(EMACS_ROOT)\src\m\intel386.h \
849 $(EMACS_ROOT)\src\config.h \
852 $(SRC)\region-cache.h
854 $(BLD)\scroll.obj : \
856 $(EMACS_ROOT)\src\s\ms-w32.h \
857 $(EMACS_ROOT)\src\m\intel386.h \
858 $(EMACS_ROOT)\src\config.h \
861 $(SRC)\dispextern.h \
864 $(BLD)\search.obj : \
866 $(EMACS_ROOT)\src\s\ms-w32.h \
867 $(EMACS_ROOT)\src\m\intel386.h \
868 $(EMACS_ROOT)\src\config.h \
873 $(SRC)\blockinput.h \
875 $(SRC)\region-cache.h
877 $(BLD)\strftime.obj : \
879 $(EMACS_ROOT)\src\s\ms-w32.h \
880 $(EMACS_ROOT)\src\m\intel386.h \
881 $(EMACS_ROOT)\src\config.h
882 $(CC) $(CFLAGS) -Dstrftime=emacs_strftime -Fo$@ strftime.c
884 $(BLD)\sunfns.obj : \
886 $(EMACS_ROOT)\src\s\ms-w32.h \
887 $(EMACS_ROOT)\src\m\intel386.h \
888 $(EMACS_ROOT)\src\config.h \
894 $(BLD)\syntax.obj : \
896 $(EMACS_ROOT)\src\s\ms-w32.h \
897 $(EMACS_ROOT)\src\m\intel386.h \
898 $(EMACS_ROOT)\src\config.h \
904 $(BLD)\sysdep.obj : \
906 $(EMACS_ROOT)\src\s\ms-w32.h \
907 $(EMACS_ROOT)\src\m\intel386.h \
908 $(EMACS_ROOT)\src\config.h \
910 $(SRC)\blockinput.h \
913 $(EMACS_ROOT)\nt\inc\sys\param.h \
914 $(EMACS_ROOT)\nt\inc\sys\file.h \
915 $(EMACS_ROOT)\nt\inc\sys\ioctl.h \
916 $(EMACS_ROOT)\nt\inc\sys\file.h \
925 $(SRC)\dispextern.h \
934 $(EMACS_ROOT)\src\acldef.h \
935 $(EMACS_ROOT)\src\chpdef.h
939 $(EMACS_ROOT)\src\s\ms-w32.h \
940 $(EMACS_ROOT)\src\m\intel386.h \
941 $(EMACS_ROOT)\src\config.h \
951 $(BLD)\termcap.obj : \
953 $(EMACS_ROOT)\src\s\ms-w32.h \
954 $(EMACS_ROOT)\src\m\intel386.h \
955 $(EMACS_ROOT)\src\config.h \
956 $(EMACS_ROOT)\nt\inc\sys\file.h
958 $(BLD)\terminfo.obj : \
961 $(BLD)\textprop.obj : \
963 $(EMACS_ROOT)\src\s\ms-w32.h \
964 $(EMACS_ROOT)\src\m\intel386.h \
965 $(EMACS_ROOT)\src\config.h \
967 $(SRC)\dispextern.h \
972 $(BLD)\tparam.obj : \
974 $(EMACS_ROOT)\src\s\ms-w32.h \
975 $(EMACS_ROOT)\src\m\intel386.h \
976 $(EMACS_ROOT)\src\config.h
980 $(EMACS_ROOT)\src\s\ms-w32.h \
981 $(EMACS_ROOT)\src\m\intel386.h \
982 $(EMACS_ROOT)\src\config.h \
987 $(BLD)\unexw32.obj : \
991 $(BLD)\vm-limit.obj : \
993 $(EMACS_ROOT)\src\s\ms-w32.h \
994 $(EMACS_ROOT)\src\m\intel386.h \
995 $(EMACS_ROOT)\src\config.h \
998 $(BLD)\widget.obj : \
1000 $(EMACS_ROOT)\src\s\ms-w32.h \
1001 $(EMACS_ROOT)\src\m\intel386.h \
1002 $(EMACS_ROOT)\src\config.h \
1006 $(SRC)\dispextern.h \
1010 $(BLD)\window.obj : \
1012 $(EMACS_ROOT)\src\s\ms-w32.h \
1013 $(EMACS_ROOT)\src\m\intel386.h \
1014 $(EMACS_ROOT)\src\config.h \
1025 $(BLD)\xdisp.obj : \
1027 $(EMACS_ROOT)\src\s\ms-w32.h \
1028 $(EMACS_ROOT)\src\m\intel386.h \
1029 $(EMACS_ROOT)\src\config.h \
1039 $(SRC)\termhooks.h \
1040 $(SRC)\dispextern.h \
1043 $(BLD)\w32faces.obj: \
1044 $(EMACS_ROOT)\src\s\ms-w32.h \
1045 $(EMACS_ROOT)\src\m\intel386.h \
1046 $(EMACS_ROOT)\src\config.h \
1052 $(SRC)\dispextern.h \
1054 $(SRC)\blockinput.h \
1058 $(BLD)\w32fns.obj: \
1059 $(EMACS_ROOT)\src\s\ms-w32.h \
1060 $(EMACS_ROOT)\src\m\intel386.h \
1061 $(EMACS_ROOT)\src\config.h \
1069 $(SRC)\dispextern.h \
1071 $(SRC)\blockinput.h \
1076 $(BLD)\w32menu.obj: \
1077 $(EMACS_ROOT)\src\s\ms-w32.h \
1078 $(EMACS_ROOT)\src\m\intel386.h \
1079 $(EMACS_ROOT)\src\config.h \
1082 $(SRC)\termhooks.h \
1086 $(SRC)\blockinput.h \
1089 $(BLD)\w32term.obj: \
1090 $(EMACS_ROOT)\src\s\ms-w32.h \
1091 $(EMACS_ROOT)\src\m\intel386.h \
1092 $(EMACS_ROOT)\src\config.h \
1095 $(SRC)\blockinput.h \
1101 $(SRC)\dispextern.h \
1102 $(SRC)\termhooks.h \
1112 $(BLD)\w32select.obj: \
1113 $(EMACS_ROOT)\src\s\ms-w32.h \
1114 $(EMACS_ROOT)\src\m\intel386.h \
1115 $(EMACS_ROOT)\src\config.h \
1116 $(SRC)\w32select.c \
1120 $(SRC)\dispextern.h \
1124 $(BLD)\w32reg.obj: \
1125 $(EMACS_ROOT)\src\s\ms-w32.h \
1126 $(EMACS_ROOT)\src\m\intel386.h \
1127 $(EMACS_ROOT)\src\config.h \