875c11468f97a0e1d7b854fd339c9e06c1a5de6a
[reactos.git] / rosapps / sysutils / makefile
1 # $Id: makefile,v 1.5 2000/05/28 17:44:51 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 BASE_CFLAGS = -I../../reactos/include
22
23
24 ROS_DIR=../../reactos
25 ROS_INC=$(ROS_DIR)/include
26 ROS_LIB=$(ROS_DIR)/lib
27 IMPORT_NTDLL=$(ROS_LIB)/ntdll/ntdll.a
28 IMPORT_FMIFS=$(ROS_LIB)/fmifs/fmifs.a
29 IMPORT_KERNEL32=$(ROS_LIB)/kernel32/kernel32.a
30 IMPORT_ADVAPI32=$(ROS_LIB)/advapi32/advapi32.a
31 IMPORT_USER32=$(ROS_LIB)/user32/user32.a
32 IMPORT_CRTDLL=$(ROS_LIB)/crtdll/crtdll.a
33
34 TARGET=\
35 regnav.exe \
36 chklib.exe \
37 qsi.exe
38 # pedump.exe \
39 # shutdown.exe \
40 # chkdsk.exe \
41 # format.exe \
42
43 all: $(TARGET)
44
45 # By Mark Russinovich
46
47 chkdsk.exe: chkdsk.o win32err.o wmain.o
48 $(CC) \
49 chkdsk.o \
50 win32err.o \
51 wmain.o \
52 $(IMPORT_FMIFS) \
53 $(IMPORT_KERNEL32) \
54 $(IMPORT_CRTDLL) \
55 -o chkdsk.exe
56 $(NM) --numeric-sort chkdsk.exe > chkdsk.sym
57
58 format.exe: format.o win32err.o wmain.o
59 $(CC) \
60 format.o \
61 win32err.o \
62 wmain.o \
63 $(IMPORT_FMIFS) \
64 $(IMPORT_KERNEL32) \
65 $(IMPORT_CRTDLL) \
66 -o format.exe
67 $(NM) --numeric-sort format.exe > format.sym
68
69 #---
70
71 chklib.exe: chklib.o win32err.o
72 $(CC) \
73 chklib.o \
74 win32err.o \
75 $(IMPORT_KERNEL32) \
76 $(IMPORT_CRTDLL) \
77 -o chklib.exe
78 $(NM) --numeric-sort chklib.exe > chklib.sym
79
80
81 regnav.exe: regnav.o win32err.o
82 $(CC) \
83 regnav.o \
84 win32err.o \
85 $(IMPORT_KERNEL32) \
86 $(IMPORT_ADVAPI32) \
87 $(IMPORT_CRTDLL) \
88 -o regnav.exe
89 $(NM) --numeric-sort regnav.exe > regnav.sym
90
91
92 shutdown.exe: shutdown.o win32err.o
93 $(CC) \
94 shutdown.o \
95 win32err.o \
96 $(IMPORT_KERNEL32) \
97 $(IMPORT_USER32) \
98 $(IMPORT_CRTDLL) \
99 -o shutdown.exe
100 $(NM) --numeric-sort shutdown.exe > shutdown.sym
101
102 qsi.exe: qsi.o
103 $(CC) \
104 qsi.o \
105 $(IMPORT_NTDLL) \
106 $(IMPORT_KERNEL32) \
107 $(IMPORT_CRTDLL) \
108 -o qsi.exe
109 $(NM) --numeric-sort qsi.exe > qsi.sym
110
111 qsi.o: qsi.c $(ROS_INC)/ddk/zwtypes.h
112
113 pedump.exe: pedump.o
114 $(CC) \
115 pedump.o \
116 $(IMPORT_NTDLL) \
117 $(IMPORT_KERNEL32) \
118 $(IMPORT_CRTDLL) \
119 -o pedump.exe
120 $(NM) --numeric-sort pedump.exe > pedump.sym
121
122 pedump.o: pedump.c
123
124 #---
125
126 CLEAN_FILES = *.o *.exe *.sym
127
128 clean: $(CLEAN_FILES:%=%_clean)
129
130 $(CLEAN_FILES:%=%_clean): %_clean:
131 - $(RM) $*
132
133 .phony: clean $(CLEAN_FILES:%=%_clean)
134
135
136 floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%)
137
138 $(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
139 ifeq ($(DOSCLI),yes)
140 $(CP) $* $(FLOPPY_DIR)\apps\$*
141 else
142 $(CP) $* $(FLOPPY_DIR)/apps/$*
143 endif
144
145
146 dist: $(TARGET:%=../$(DIST_DIR)/apps/%)
147
148 $(TARGET:%=../$(DIST_DIR)/apps/%): ../$(DIST_DIR)/apps/%: %
149 ifeq ($(DOSCLI),yes)
150 $(CP) $* ..\$(DIST_DIR)\apps\$*
151 else
152 $(CP) $* ../$(DIST_DIR)/apps/$*
153 endif
154
155 include ../rules.mak
156
157 # EOF