1b4542e99ca8562aa584e15df8ef35356ff8c10feElliott Hughes# Makefile fragment for building mksh R50 2014/10/03
2427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes
3427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesPROG=		mksh
4427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesMAN=		mksh.1
5427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesSRCS=		lalloc.c eval.c exec.c expr.c funcs.c histrap.c jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c edit.c
6427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesSRCS_FP=	../src/lalloc.c ../src/eval.c ../src/exec.c ../src/expr.c ../src/funcs.c ../src/histrap.c ../src/jobs.c ../src/lex.c ../src/main.c ../src/misc.c ../src/shf.c ../src/syn.c ../src/tree.c ../src/var.c ../src/edit.c
7427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesOBJS_BP=	 lalloc.o eval.o exec.o expr.o funcs.o histrap.o jobs.o lex.o main.o misc.o shf.o syn.o tree.o var.o edit.o
8427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesINDSRCS=	emacsfn.h rlimits.opt sh.h sh_flags.opt var_spec.h
9427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesNONSRCS_INST=	dot.mkshrc $(MAN)
10427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott HughesNONSRCS_NOINST=	Build.sh Makefile Rebuild.sh check.pl check.t test.sh
11b4542e99ca8562aa584e15df8ef35356ff8c10feElliott HughesCC=		/huge-ssd/aosp-x86_64/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8/bin/*-gcc
12b4542e99ca8562aa584e15df8ef35356ff8c10feElliott HughesCFLAGS=		 -fno-exceptions -Wno-multichar -fpic -fPIE -ffunction-sections -fdata-sections -funwind-tables -fstack-protector -Wa,--noexecstack -Werror=format-security -fno-short-enums -Wno-unused-but-set-variable -fno-builtin-sin -fno-strict-volatile-bitfields -Wno-psabi -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -g -Wstrict-aliasing=2 -fgcse-after-reload -frerun-cse-after-loop -frename-registers -Os -fomit-frame-pointer -fno-strict-aliasing -Wno-deprecated-declarations -fno-asynchronous-unwind-tables -fwrapv
13b4542e99ca8562aa584e15df8ef35356ff8c10feElliott HughesCPPFLAGS=	-I. -I'../src'  -isystem /huge-ssd/aosp-x86_64/bionic/libc/arch-x86/include -isystem /huge-ssd/aosp-x86_64/bionic/libc/include -isystem /huge-ssd/aosp-x86_64/bionic/libc/kernel/uapi -isystem /huge-ssd/aosp-x86_64/bionic/libc/kernel/uapi/asm-x86 -isystem /huge-ssd/aosp-x86_64/bionic/libm/include -isystem /huge-ssd/aosp-x86_64/bionic/libm/include/x86 -D_FORTIFY_SOURCE=2 -I/huge-ssd/aosp-x86_64/build/core/combo/include/arch/linux-x86/ -DANDROID -DNDEBUG -UDEBUG -DDEBUG_LEAKS -DMKSH_ASSUME_UTF8 -DMKSH_CONSERVATIVE_FDS -DMKSH_DONT_EMIT_IDSTRING -DMKSH_NOPWNAM -DMKSH_BUILDSH -D_GNU_SOURCE -DSETUID_CAN_FAIL_WITH_EAGAIN -DHAVE_ATTRIBUTE_BOUNDED=0 -DHAVE_ATTRIBUTE_FORMAT=1 -DHAVE_ATTRIBUTE_NORETURN=1 -DHAVE_ATTRIBUTE_PURE=1 -DHAVE_ATTRIBUTE_UNUSED=1 -DHAVE_ATTRIBUTE_USED=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TIME_H=1 -DHAVE_BOTH_TIME_H=1 -DHAVE_SYS_BSDTYPES_H=0 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_MKDEV_H=0 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SYSMACROS_H=1 -DHAVE_BSTRING_H=0 -DHAVE_GRP_H=1 -DHAVE_LIBGEN_H=1 -DHAVE_LIBUTIL_H=0 -DHAVE_PATHS_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_TERMIOS_H=1 -DHAVE_ULIMIT_H=0 -DHAVE_VALUES_H=0 -DHAVE_CAN_INTTYPES=1 -DHAVE_CAN_UCBINTS=1 -DHAVE_CAN_INT8TYPE=1 -DHAVE_CAN_UCBINT8=1 -DHAVE_RLIM_T=1 -DHAVE_SIG_T=1 -DHAVE_SYS_ERRLIST=0 -DHAVE_SYS_SIGNAME=1 -DHAVE_SYS_SIGLIST=1 -DHAVE_FLOCK=1 -DHAVE_LOCK_FCNTL=1 -DHAVE_GETRUSAGE=1 -DHAVE_GETSID=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_ISSETUGID=0 -DHAVE_KILLPG=1 -DHAVE_MEMMOVE=1 -DHAVE_MKNOD=0 -DHAVE_MMAP=1 -DHAVE_NICE=1 -DHAVE_REVOKE=0 -DHAVE_SETLOCALE_CTYPE=0 -DHAVE_LANGINFO_CODESET=0 -DHAVE_SELECT=1 -DHAVE_SETRESUGID=1 -DHAVE_SETGROUPS=1 -DHAVE_STRERROR=1 -DHAVE_STRSIGNAL=0 -DHAVE_STRLCPY=1 -DHAVE_FLOCK_DECL=1 -DHAVE_REVOKE_DECL=1 -DHAVE_SYS_ERRLIST_DECL=0 -DHAVE_SYS_SIGLIST_DECL=1 -DHAVE_PERSISTENT_HISTORY=0 -DMKSH_BUILD_R=503
14b4542e99ca8562aa584e15df8ef35356ff8c10feElliott HughesLDFLAGS=	 -nostdlib -Bdynamic -fPIE -pie -Wl,-dynamic-linker,/system/bin/linker -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined /huge-ssd/aosp-x86_64/out/target/product/generic_x86_64/obj/lib/crtbegin_dynamic.o
15b4542e99ca8562aa584e15df8ef35356ff8c10feElliott HughesLIBS=		 -L/huge-ssd/aosp-x86_64/out/target/product/generic_x86_64/obj/lib -Wl,-rpath-link=/huge-ssd/aosp-x86_64/out/target/product/generic_x86_64/obj/lib -Wl,--no-whole-archive /huge-ssd/aosp-x86_64/out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libcompiler_rt-extras_intermediates/libcompiler_rt-extras.a -lc /huge-ssd/aosp-x86_64/out/target/product/generic_x86_64/obj/lib/crtend_android.o
16427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes
17427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes.depend $(OBJS_BP): rlimits.gen sh_flags.gen
18427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughesrlimits.gen: ../src/Build.sh ../src/rlimits.opt
19427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes			srcfile=../src/rlimits.opt; BUILDSH_RUN_GENOPT=1; . ../src/Build.sh
20427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughessh_flags.gen: ../src/Build.sh ../src/sh_flags.opt
21427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes			srcfile=../src/sh_flags.opt; BUILDSH_RUN_GENOPT=1; . ../src/Build.sh
22427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes
23427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes# not BSD make only:
24427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#VPATH=		../src
25427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#all: $(PROG)
26427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#$(PROG): $(OBJS_BP)
27427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BP) $(LIBS)
28427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#$(OBJS_BP): $(SRCS_FP) $(NONSRCS)
29427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#.c.o:
30427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
31427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes
32427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes# for all make variants:
33427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#REGRESS_FLAGS=	-f
34427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#regress:
35427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#	./test.sh $(REGRESS_FLAGS)
36427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughescheck_categories= shell:legacy-no int:32 android convfds no-histfile
37427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes
38427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes# for BSD make only:
39427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#.PATH: ../src
40427d76ccc44aea287b51b233f0254a6107b2b3d1Elliott Hughes#.include <bsd.prog.mk>
41