Build: Sync the compile check changes from CMakeLists.txt
[xz/debian.git] / dos / Makefile
blobf8ba43726f9250319e188af8791cda8481f6e266
1 # SPDX-License-Identifier: 0BSD
3 ###############################################################################
5 # Makefile to build XZ Utils using DJGPP
7 # Author: Lasse Collin
9 ###############################################################################
11 # For debugging, set comment "#define NDEBUG 1" from config.h to enable
12 # the assert() macro, set STRIP=rem to disable stripping, and finally
13 # e.g. CFLAGS="-g -O0".
14 CC = gcc
15 STRIP = strip
16 CPPFLAGS =
17 CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
18 LDFLAGS = -lemu
20 ALL_CFLAGS = -std=gnu99
22 ALL_CPPFLAGS = \
23 -I. \
24 -I../lib \
25 -I../src/common \
26 -I../src/liblzma/api \
27 -I../src/liblzma/common \
28 -I../src/liblzma/check \
29 -I../src/liblzma/rangecoder \
30 -I../src/liblzma/lz \
31 -I../src/liblzma/lzma \
32 -I../src/liblzma/delta \
33 -I../src/liblzma/simple \
34 -DHAVE_CONFIG_H
36 ALL_CPPFLAGS += $(CPPFLAGS)
37 ALL_CFLAGS += $(CFLAGS)
39 .PHONY: all
40 all: xz.exe
42 SRCS_C = \
43 ../lib/getopt.c \
44 ../lib/getopt1.c \
45 ../src/common/tuklib_cpucores.c \
46 ../src/common/tuklib_exit.c \
47 ../src/common/tuklib_mbstr_fw.c \
48 ../src/common/tuklib_mbstr_width.c \
49 ../src/common/tuklib_open_stdxxx.c \
50 ../src/common/tuklib_physmem.c \
51 ../src/common/tuklib_progname.c \
52 ../src/liblzma/check/check.c \
53 ../src/liblzma/check/crc32_table.c \
54 ../src/liblzma/check/crc64_table.c \
55 ../src/liblzma/check/sha256.c \
56 ../src/liblzma/common/alone_decoder.c \
57 ../src/liblzma/common/alone_encoder.c \
58 ../src/liblzma/common/block_decoder.c \
59 ../src/liblzma/common/block_encoder.c \
60 ../src/liblzma/common/block_header_decoder.c \
61 ../src/liblzma/common/block_header_encoder.c \
62 ../src/liblzma/common/block_util.c \
63 ../src/liblzma/common/common.c \
64 ../src/liblzma/common/file_info.c \
65 ../src/liblzma/common/filter_common.c \
66 ../src/liblzma/common/filter_decoder.c \
67 ../src/liblzma/common/filter_encoder.c \
68 ../src/liblzma/common/filter_flags_decoder.c \
69 ../src/liblzma/common/filter_flags_encoder.c \
70 ../src/liblzma/common/hardware_physmem.c \
71 ../src/liblzma/common/index.c \
72 ../src/liblzma/common/index_decoder.c \
73 ../src/liblzma/common/index_encoder.c \
74 ../src/liblzma/common/index_hash.c \
75 ../src/liblzma/common/lzip_decoder.c \
76 ../src/liblzma/common/stream_decoder.c \
77 ../src/liblzma/common/stream_encoder.c \
78 ../src/liblzma/common/stream_flags_common.c \
79 ../src/liblzma/common/stream_flags_decoder.c \
80 ../src/liblzma/common/stream_flags_encoder.c \
81 ../src/liblzma/common/string_conversion.c \
82 ../src/liblzma/common/vli_decoder.c \
83 ../src/liblzma/common/vli_encoder.c \
84 ../src/liblzma/common/vli_size.c \
85 ../src/liblzma/delta/delta_common.c \
86 ../src/liblzma/delta/delta_decoder.c \
87 ../src/liblzma/delta/delta_encoder.c \
88 ../src/liblzma/lz/lz_decoder.c \
89 ../src/liblzma/lz/lz_encoder.c \
90 ../src/liblzma/lz/lz_encoder_mf.c \
91 ../src/liblzma/lzma/fastpos_table.c \
92 ../src/liblzma/lzma/lzma2_decoder.c \
93 ../src/liblzma/lzma/lzma2_encoder.c \
94 ../src/liblzma/lzma/lzma_decoder.c \
95 ../src/liblzma/lzma/lzma_encoder.c \
96 ../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
97 ../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
98 ../src/liblzma/lzma/lzma_encoder_presets.c \
99 ../src/liblzma/rangecoder/price_table.c \
100 ../src/liblzma/simple/arm.c \
101 ../src/liblzma/simple/arm64.c \
102 ../src/liblzma/simple/armthumb.c \
103 ../src/liblzma/simple/ia64.c \
104 ../src/liblzma/simple/powerpc.c \
105 ../src/liblzma/simple/simple_coder.c \
106 ../src/liblzma/simple/simple_decoder.c \
107 ../src/liblzma/simple/simple_encoder.c \
108 ../src/liblzma/simple/sparc.c \
109 ../src/liblzma/simple/x86.c \
110 ../src/xz/args.c \
111 ../src/xz/coder.c \
112 ../src/xz/file_io.c \
113 ../src/xz/hardware.c \
114 ../src/xz/list.c \
115 ../src/xz/main.c \
116 ../src/xz/message.c \
117 ../src/xz/mytime.c \
118 ../src/xz/options.c \
119 ../src/xz/signals.c \
120 ../src/xz/suffix.c \
121 ../src/xz/util.c
122 SRCS_ASM = \
123 ../src/liblzma/check/crc32_x86.S \
124 ../src/liblzma/check/crc64_x86.S
126 OBJS_C = $(SRCS_C:.c=.o)
127 OBJS_ASM = $(SRCS_ASM:.S=.o)
128 OBJS = $(OBJS_C) $(OBJS_ASM)
130 getopt.h:
131 update ../lib/getopt.in.h getopt.h
133 $(OBJS): getopt.h
135 $(OBJS_C): %.o: %.c
136 $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
138 $(OBJS_ASM): %.o: %.S
139 $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
141 # Make xz.exe not depend on an external DPMI server.
142 xz.exe: $(OBJS)
143 $(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@
144 $(STRIP) --strip-all $@
145 exe2coff $@
146 del $@
147 copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
148 del $(@:.exe=)