Import libs now have a "lib" prefix
[reactos.git] / rosapps / sysutils / makefile
1 # $Id: makefile,v 1.15 2004/12/27 20:09:57 gvg 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 -D_M_IX86
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)/libntdll.a
35 IMPORT_FMIFS=$(ROS_LIB)/libfmifs.a
36 IMPORT_KERNEL32=$(ROS_LIB)/libkernel32.a
37 IMPORT_ADVAPI32=$(ROS_LIB)/libadvapi32.a
38 IMPORT_USER32=$(ROS_LIB)/libuser32.a
39 IMPORT_MSVCRT=
40
41 TARGET=\
42 chklib.exe \
43 ldd.exe \
44 pedump.exe \
45 shutdown.exe \
46 chkdsk.exe \
47 format.exe
48
49 # Removed due to dependance on C++ compiler
50 #
51 # regexpl/regexpl.exe
52 #
53
54 all: $(TARGET)
55
56
57 # By Mark Russinovich
58
59 chkdsk.exe: chkdsk.o win32err.o wmain.o chkdsk.coff
60 $(CC) \
61 chkdsk.o \
62 win32err.o \
63 wmain.o \
64 chkdsk.coff \
65 $(IMPORT_FMIFS) \
66 $(IMPORT_KERNEL32) \
67 $(IMPORT_MSVCRT) \
68 -o chkdsk.exe
69 $(NM) --numeric-sort chkdsk.exe > chkdsk.sym
70
71 format.exe: format.o win32err.o wmain.o format.coff
72 $(CC) \
73 format.o \
74 win32err.o \
75 wmain.o \
76 format.coff \
77 $(IMPORT_FMIFS) \
78 $(IMPORT_KERNEL32) \
79 $(IMPORT_MSVCRT) \
80 -o format.exe
81 $(NM) --numeric-sort format.exe > format.sym
82
83 #---
84
85 chklib.exe: chklib.o win32err.o chklib.coff
86 $(CC) \
87 chklib.o \
88 win32err.o \
89 chklib.coff \
90 $(IMPORT_KERNEL32) \
91 $(IMPORT_MSVCRT) \
92 -o chklib.exe
93 $(NM) --numeric-sort chklib.exe > chklib.sym
94
95
96 shutdown.exe: shutdown.o win32err.o shutdown.coff
97 $(CC) \
98 shutdown.o \
99 win32err.o \
100 shutdown.coff \
101 $(IMPORT_KERNEL32) \
102 $(IMPORT_USER32) \
103 $(IMPORT_MSVCRT) \
104 -o shutdown.exe
105 $(NM) --numeric-sort shutdown.exe > shutdown.sym
106
107 pedump.exe: pedump.o pedump.coff
108 $(CC) \
109 pedump.o \
110 pedump.coff \
111 $(IMPORT_NTDLL) \
112 $(IMPORT_KERNEL32) \
113 $(IMPORT_MSVCRT) \
114 -o pedump.exe
115 $(NM) --numeric-sort pedump.exe > pedump.sym
116
117 pedump.o: pedump.c
118
119 ldd.exe: ldd.o win32err.o ldd.coff
120 $(CC) \
121 ldd.o \
122 win32err.o \
123 ldd.coff \
124 $(IMPORT_KERNEL32) \
125 $(IMPORT_MSVCRT) \
126 -o ldd.exe
127 $(NM) --numeric-sort ldd.exe > ldd.sym
128
129 ldd.o: ldd.c
130
131 # By Nedko Arnaoudov
132
133 regexpl/regexpl.exe:
134 make -C regexpl
135
136 #---
137
138 install:
139
140 .phony: install
141
142 CLEAN_FILES = *.o *.exe *.sym
143
144 clean: $(CLEAN_FILES:%=%_clean)
145
146 $(CLEAN_FILES:%=%_clean): %_clean:
147 - $(RM) $*
148
149 .phony: clean $(CLEAN_FILES:%=%_clean)
150
151
152 floppy: $(TARGET:%=$(FLOPPY_DIR)/apps/%)
153
154 $(TARGET:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
155 ifeq ($(DOSCLI),yes)
156 $(CP) $* $(FLOPPY_DIR)\apps\$*
157 else
158 $(CP) $* $(FLOPPY_DIR)/apps/$*
159 endif
160
161
162 dist: $(TARGET:%=../$(DIST_DIR)/apps/%)
163
164 $(TARGET:%=../$(DIST_DIR)/apps/%): ../$(DIST_DIR)/apps/%: %
165 ifeq ($(DOSCLI),yes)
166 $(CP) $* ..\$(DIST_DIR)\apps\$*
167 else
168 $(CP) $* ../$(DIST_DIR)/apps/$*
169 endif
170
171 include ../rules.mak
172
173 # EOF