2009-02-13 11:23:50 -05:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# Makefile to build XZ Utils using DJGPP
|
|
|
|
#
|
|
|
|
# Author: Lasse Collin
|
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
# For debugging, set comment "#define NDEBUG 1" from config.h to enable
|
|
|
|
# the assert() macro, set STRIP=rem to disable stripping, and finally
|
|
|
|
# e.g. CFLAGS="-g -O0".
|
2009-02-13 11:23:50 -05:00
|
|
|
CC = gcc
|
|
|
|
STRIP = strip
|
2010-10-09 12:28:49 -04:00
|
|
|
CPPFLAGS =
|
|
|
|
CFLAGS = -g -Wall -Wextra -Wfatal-errors -march=i386 -mtune=i686 -O2
|
2012-04-19 07:17:52 -04:00
|
|
|
LDFLAGS = -lemu
|
2009-02-13 11:23:50 -05:00
|
|
|
|
2020-03-11 13:38:08 -04:00
|
|
|
ALL_CFLAGS = -std=gnu99
|
2009-02-13 11:23:50 -05:00
|
|
|
|
|
|
|
ALL_CPPFLAGS = \
|
|
|
|
-I. \
|
|
|
|
-I../lib \
|
|
|
|
-I../src/common \
|
|
|
|
-I../src/liblzma/api \
|
|
|
|
-I../src/liblzma/common \
|
|
|
|
-I../src/liblzma/check \
|
|
|
|
-I../src/liblzma/rangecoder \
|
|
|
|
-I../src/liblzma/lz \
|
|
|
|
-I../src/liblzma/lzma \
|
|
|
|
-I../src/liblzma/delta \
|
|
|
|
-I../src/liblzma/simple \
|
2010-10-09 12:28:49 -04:00
|
|
|
-DHAVE_CONFIG_H
|
2009-02-13 11:23:50 -05:00
|
|
|
|
|
|
|
ALL_CPPFLAGS += $(CPPFLAGS)
|
|
|
|
ALL_CFLAGS += $(CFLAGS)
|
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
.PHONY: all
|
|
|
|
all: xz.exe
|
2009-02-13 11:23:50 -05:00
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
SRCS_C = \
|
|
|
|
../lib/getopt.c \
|
|
|
|
../lib/getopt1.c \
|
|
|
|
../src/common/tuklib_cpucores.c \
|
|
|
|
../src/common/tuklib_exit.c \
|
|
|
|
../src/common/tuklib_mbstr_fw.c \
|
|
|
|
../src/common/tuklib_mbstr_width.c \
|
|
|
|
../src/common/tuklib_open_stdxxx.c \
|
|
|
|
../src/common/tuklib_physmem.c \
|
|
|
|
../src/common/tuklib_progname.c \
|
|
|
|
../src/liblzma/check/check.c \
|
|
|
|
../src/liblzma/check/crc32_table.c \
|
|
|
|
../src/liblzma/check/crc64_table.c \
|
|
|
|
../src/liblzma/check/sha256.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/common/alone_decoder.c \
|
|
|
|
../src/liblzma/common/alone_encoder.c \
|
|
|
|
../src/liblzma/common/block_decoder.c \
|
|
|
|
../src/liblzma/common/block_encoder.c \
|
|
|
|
../src/liblzma/common/block_header_decoder.c \
|
|
|
|
../src/liblzma/common/block_header_encoder.c \
|
|
|
|
../src/liblzma/common/block_util.c \
|
|
|
|
../src/liblzma/common/common.c \
|
2018-04-29 11:44:47 -04:00
|
|
|
../src/liblzma/common/file_info.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/common/filter_common.c \
|
|
|
|
../src/liblzma/common/filter_decoder.c \
|
|
|
|
../src/liblzma/common/filter_encoder.c \
|
|
|
|
../src/liblzma/common/filter_flags_decoder.c \
|
|
|
|
../src/liblzma/common/filter_flags_encoder.c \
|
2010-10-09 12:28:49 -04:00
|
|
|
../src/liblzma/common/hardware_physmem.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/common/index.c \
|
|
|
|
../src/liblzma/common/index_decoder.c \
|
|
|
|
../src/liblzma/common/index_encoder.c \
|
|
|
|
../src/liblzma/common/index_hash.c \
|
2022-11-09 07:57:48 -05:00
|
|
|
../src/liblzma/common/lzip_decoder.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/common/stream_decoder.c \
|
|
|
|
../src/liblzma/common/stream_encoder.c \
|
|
|
|
../src/liblzma/common/stream_flags_common.c \
|
|
|
|
../src/liblzma/common/stream_flags_decoder.c \
|
|
|
|
../src/liblzma/common/stream_flags_encoder.c \
|
2022-11-30 10:50:17 -05:00
|
|
|
../src/liblzma/common/string_conversion.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/common/vli_decoder.c \
|
|
|
|
../src/liblzma/common/vli_encoder.c \
|
|
|
|
../src/liblzma/common/vli_size.c \
|
2010-10-09 12:28:49 -04:00
|
|
|
../src/liblzma/delta/delta_common.c \
|
|
|
|
../src/liblzma/delta/delta_decoder.c \
|
|
|
|
../src/liblzma/delta/delta_encoder.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/lz/lz_decoder.c \
|
|
|
|
../src/liblzma/lz/lz_encoder.c \
|
|
|
|
../src/liblzma/lz/lz_encoder_mf.c \
|
|
|
|
../src/liblzma/lzma/fastpos_table.c \
|
|
|
|
../src/liblzma/lzma/lzma2_decoder.c \
|
|
|
|
../src/liblzma/lzma/lzma2_encoder.c \
|
|
|
|
../src/liblzma/lzma/lzma_decoder.c \
|
|
|
|
../src/liblzma/lzma/lzma_encoder.c \
|
|
|
|
../src/liblzma/lzma/lzma_encoder_optimum_fast.c \
|
|
|
|
../src/liblzma/lzma/lzma_encoder_optimum_normal.c \
|
|
|
|
../src/liblzma/lzma/lzma_encoder_presets.c \
|
2010-10-09 12:28:49 -04:00
|
|
|
../src/liblzma/rangecoder/price_table.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/simple/arm.c \
|
2022-11-09 07:57:48 -05:00
|
|
|
../src/liblzma/simple/arm64.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/liblzma/simple/armthumb.c \
|
|
|
|
../src/liblzma/simple/ia64.c \
|
|
|
|
../src/liblzma/simple/powerpc.c \
|
|
|
|
../src/liblzma/simple/simple_coder.c \
|
|
|
|
../src/liblzma/simple/simple_decoder.c \
|
|
|
|
../src/liblzma/simple/simple_encoder.c \
|
|
|
|
../src/liblzma/simple/sparc.c \
|
2010-10-09 12:28:49 -04:00
|
|
|
../src/liblzma/simple/x86.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/xz/args.c \
|
2009-06-26 13:49:54 -04:00
|
|
|
../src/xz/coder.c \
|
|
|
|
../src/xz/file_io.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/xz/hardware.c \
|
2010-10-09 12:28:49 -04:00
|
|
|
../src/xz/list.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/xz/main.c \
|
|
|
|
../src/xz/message.c \
|
2014-12-21 13:48:37 -05:00
|
|
|
../src/xz/mytime.c \
|
2009-02-13 11:23:50 -05:00
|
|
|
../src/xz/options.c \
|
|
|
|
../src/xz/signals.c \
|
|
|
|
../src/xz/suffix.c \
|
|
|
|
../src/xz/util.c
|
2010-10-09 12:28:49 -04:00
|
|
|
SRCS_ASM = \
|
|
|
|
../src/liblzma/check/crc32_x86.S \
|
|
|
|
../src/liblzma/check/crc64_x86.S
|
|
|
|
|
|
|
|
OBJS_C = $(SRCS_C:.c=.o)
|
|
|
|
OBJS_ASM = $(SRCS_ASM:.S=.o)
|
|
|
|
OBJS = $(OBJS_C) $(OBJS_ASM)
|
|
|
|
|
|
|
|
getopt.h:
|
|
|
|
update ../lib/getopt.in.h getopt.h
|
2009-02-13 11:23:50 -05:00
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
$(OBJS): getopt.h
|
2009-02-13 11:23:50 -05:00
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
$(OBJS_C): %.o: %.c
|
2009-02-13 11:23:50 -05:00
|
|
|
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
|
|
|
|
2010-10-09 12:28:49 -04:00
|
|
|
$(OBJS_ASM): %.o: %.S
|
|
|
|
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
# Make xz.exe not depend on an external DPMI server.
|
|
|
|
xz.exe: $(OBJS)
|
|
|
|
$(CC) $(ALL_CFLAGS) $(OBJS) $(LDFLAGS) -o $@
|
2009-02-13 11:23:50 -05:00
|
|
|
$(STRIP) --strip-all $@
|
|
|
|
exe2coff $@
|
2010-10-09 12:28:49 -04:00
|
|
|
del $@
|
2009-02-13 11:23:50 -05:00
|
|
|
copy /b $(DJGPP:DJGPP.ENV=BIN\CWSDSTUB.EXE) + $(@:.exe=) $@
|
2010-10-09 12:28:49 -04:00
|
|
|
del $(@:.exe=)
|