Fixes to compile the whole set of ROS applications.
[reactos.git] / rosapps / sysutils / makefile
1 # $Id: makefile,v 1.10 2001/10/16 21:02:02 ea Exp $
2 #
3 # ReactOS System Utilities
4 #
5 # 1999-02-16 (Emanuele Aliberti)
6 # Added chkdskx.c and formatx.c by Mark Russinovich
7 # (mark@sysinternals.com) and shutdown.c
8 #
9 # 1999-03-03 (Emanuele Aliberti)
10 # Added login.c and chklib.c
11 #
12 # 1999-03-16 (Emanuele Aliberti)
13 # Added regnav.c
14 #
15 # 1999-12-19 (ea)
16 # Added qsi.c
17 #
18 # 2000-04-23 (ea)
19 # Added pedump.c
20 #
21 # 2000-08-4 (ea)
22 # Added ldd.c; removed login.c
23 #
24 #
25 PATH_TO_TOP=..
26 PATH_TO_CVSROOT=../$(PATH_TO_TOP)
27
28 BASE_CFLAGS = -I$(PATH_TO_CVSROOT)/reactos/include
29
30
31 ROS_DIR=$(PATH_TO_CVSROOT)/reactos
32 ROS_INC=$(ROS_DIR)/include
33 ROS_LIB=$(ROS_DIR)/dk/w32/lib
34 IMPORT_NTDLL=$(ROS_LIB)/ntdll.a
35 IMPORT_FMIFS=$(ROS_LIB)/fmifs.a
36 IMPORT_KERNEL32=$(ROS_LIB)/kernel32.a
37 IMPORT_ADVAPI32=$(ROS_LIB)/advapi32.a
38 IMPORT_USER32=$(ROS_LIB)/user32.a
39 IMPORT_MSVCRT=$(ROS_LIB)/msvcrt.a
40
41 TARGET=\
42 chklib$(EXE_POSTFIX) \
43 ldd$(EXE_POSTFIX) \
44 pedump$(EXE_POSTFIX) \
45 shutdown$(EXE_POSTFIX) \
46 chkdsk$(EXE_POSTFIX) \
47 format$(EXE_POSTFIX) \
48 regexpl/regexpl$(EXE_POSTFIX)
49
50 all: $(TARGET)
51
52
53 # By Mark Russinovich
54
55 chkdsk.exe: chkdsk.o win32err.o wmain.o chkdsk.coff
56 $(CC) \
57 chkdsk.o \
58 win32err.o \
59 wmain.o \
60 chkdsk.coff \
61 $(IMPORT_FMIFS) \
62 $(IMPORT_KERNEL32) \
63 $(IMPORT_MSVCRT) \
64 -o chkdsk.exe
65 $(NM) --numeric-sort chkdsk.exe > chkdsk.sym
66
67 format.exe: format.o win32err.o wmain.o format.coff
68 $(CC) \
69 format.o \
70 win32err.o \
71 wmain.o \
72 format.coff \
73 $(IMPORT_FMIFS) \
74 $(IMPORT_KERNEL32) \
75 $(IMPORT_MSVCRT) \
76 -o format.exe
77 $(NM) --numeric-sort format.exe > format.sym
78
79 #---
80
81 chklib.exe: chklib.o win32err.o chklib.coff
82 $(CC) \
83 chklib.o \
84 win32err.o \
85 chklib.coff \
86 $(IMPORT_KERNEL32) \
87 $(IMPORT_MSVCRT) \
88 -o chklib.exe
89 $(NM) --numeric-sort chklib.exe > chklib.sym
90
91
92 shutdown.exe: shutdown.o win32err.o shutdown.coff
93 $(CC) \
94 shutdown.o \
95 win32err.o \
96 shutdown.coff \
97 $(IMPORT_KERNEL32) \
98 $(IMPORT_USER32) \
99 $(IMPORT_MSVCRT) \
100 -o shutdown.exe
101 $(NM) --numeric-sort shutdown.exe > shutdown.sym
102
103 pedump.exe: pedump.o pedump.coff
104 $(CC) \
105 pedump.o \
106 pedump.coff \
107 $(IMPORT_NTDLL) \
108 $(IMPORT_KERNEL32) \
109 $(IMPORT_MSVCRT) \
110 -o pedump.exe
111 $(NM) --numeric-sort pedump.exe > pedump.sym
112
113 pedump.o: pedump.c
114
115 ldd.exe: ldd.o win32err.o ldd.coff
116 $(CC) \
117 ldd.o \
118 win32err.o \
119 ldd.coff \
120 $(IMPORT_KERNEL32) \
121 $(IMPORT_MSVCRT) \
122 -o ldd.exe
123 $(NM) --numeric-sort ldd.exe > ldd.sym
124
125 ldd.o: ldd.c
126
127 # By Nedko Arnaoudov
128
129 regexpl/regexpl$(EXE_POSTFIX):
130 make -C regexpl
131
132 #---
133
134 CLEAN_FILES = *.o *.exe *.sym
135
136 clean: $(CLEAN_FILES:%=%_clean)
137
138 $(CLEAN_FILES:%=%_clean): %_clean:
139 - $(RM) $*
140
141 .phony: clean $(CLEAN_FILES:%=%_clean)
142
143
144 floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%)
145
146 $(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
147 ifeq ($(DOSCLI),yes)
148 $(CP) $* $(FLOPPY_DIR)\apps\$*
149 else
150 $(CP) $* $(FLOPPY_DIR)/apps/$*
151 endif
152
153
154 dist: $(TARGET:%=../$(DIST_DIR)/apps/%)
155
156 $(TARGET:%=../$(DIST_DIR)/apps/%): ../$(DIST_DIR)/apps/%: %
157 ifeq ($(DOSCLI),yes)
158 $(CP) $* ..\$(DIST_DIR)\apps\$*
159 else
160 $(CP) $* ../$(DIST_DIR)/apps/$*
161 endif
162
163 include ../rules.mak
164
165 # EOF