view test/resolve_self/Makefile.embedded @ 665:ef356272a1c7 default tip

- introduced Makefile var APP_SUFFIX to handle cases where compilers implicitly add an extension to executables (e.g. llvm/mingw64 adds .exe even of not specified via -o)
author Tassilo Philipp
date Thu, 20 Jun 2024 17:10:12 +0200
parents 2536413edfd8
children
line wrap: on
line source

APP = resolve_self
OBJS = main.o

TOP      = ../..
CFLAGS  += -I${TOP}/dynload
LDFLAGS += -L${TOP}/dynload
LDLIBS  += -ldynload_s

all: ${APP}

.PHONY: all clean install

${APP}: ${OBJS} 
	# some linkers (e.g. older apple mach-o linkers) don't know
	# --export-dynamic, so try without if link fails; this is a bit hacky and
	#  should prob be part of of the ./configure run
	${CC} ${CFLAGS} ${LDFLAGS} -Wl,--export-dynamic ${OBJS} ${LDLIBS_D} ${LDLIBS} -o ${APP} || \
		${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} ${LDLIBS_D} ${LDLIBS} -o ${APP}

clean:
	rm -f ${APP} ${OBJS}