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