branch update for HEAD-2003021201
[reactos.git] / apps / utils / cabman / makefile
1 #
2 # Makefile for ReactOS Cabinet Manager
3 #
4 PATH_TO_TOP = ../../..
5
6 #FIXME: why doesn't this work?
7 #ZLIB_OBJECTS    = $(PATH_TO_TOP)/drivers/lib/zlib/zlib.a
8 ZLIB_PATH = $(PATH_TO_TOP)/drivers/lib/zlib
9
10 ZLIB_OBJECTS    = $(ZLIB_PATH)/adler32.o $(ZLIB_PATH)/deflate.o \
11                   $(ZLIB_PATH)/infblock.o $(ZLIB_PATH)/infcodes.o \
12                   $(ZLIB_PATH)/inflate.o $(ZLIB_PATH)/inftrees.o \
13                   $(ZLIB_PATH)/infutil.o $(ZLIB_PATH)/inffast.o \
14                   $(ZLIB_PATH)/trees.o $(ZLIB_PATH)/zutil.o
15 ENGINE_OBJECTS  = $(ZLIB_OBJECTS) cabinet.o mszip.o raw.o
16 TEST_OBJECTS    = $(ENGINE_OBJECTS) test.o
17 OBJECTS         = $(ENGINE_OBJECTS) main.o dfp.o
18 TARGET          = cabman
19 PROGS           = $(TARGET).exe test.exe
20
21 #FIXME: zlib should be compiled and installed in the SDK by the master makefile
22 CFLAGS          += -O3 -I$(ZLIB_PATH)
23
24 CLEAN_FILES = *.o $(TARGET).exe $(TARGET).sym test.exe test.sym
25
26 all: $(PROGS)
27
28 clean: 
29         - $(RM) $(CLEAN_FILES)
30
31 .phony: clean 
32
33 install: $(PROGS:%=$(FLOPPY_DIR)/apps/%)
34
35 $(PROGS:%=$(FLOPPY_DIR)/apps/%): $(FLOPPY_DIR)/apps/%: %
36 ifeq ($(DOSCLI),yes)
37         $(CP) $* $(FLOPPY_DIR)\apps\$*
38 else
39         $(CP) $* $(FLOPPY_DIR)/apps/$*
40 endif
41
42 dist: $(PROGS:%=../../$(DIST_DIR)/apps/%)
43
44 $(PROGS:%=../../$(DIST_DIR)/apps/%): ../../$(DIST_DIR)/apps/%: %
45 ifeq ($(DOSCLI),yes)
46         $(CP) $* ..\..\$(DIST_DIR)\apps\$*
47 else
48         $(CP) $* ../../$(DIST_DIR)/apps/$*
49 endif
50
51 #FIXME: zlib should be compiled and installed in the SDK by the master makefile
52 $(ZLIB_PATH)/zlib.a:
53         make -C $(ZLIB_PATH) -f makefile.reactos
54
55 $(TARGET).exe: $(OBJECTS) $(ZLIB_PATH)/zlib.a
56         $(CC) $(OBJECTS) -lstdc++ -o $(TARGET).exe
57         $(NM) --numeric-sort $(TARGET).exe > $(TARGET).sym
58         
59 test.exe: $(TEST_OBJECTS)
60         $(CC) $(TEST_OBJECTS) -lstdc++ -o test.exe
61         $(NM) --numeric-sort test.exe > test.sym
62
63 include ../../../rules.mak
64