From fd93c3999636cbbc7f327a173ac1079c74c4bef5 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 18 Nov 2020 16:32:27 +0000 Subject: Finally Makefile is goodio FossilOrigin-Name: ecd68fea526e3457a8f54a8d8ee81ae51d816446 --- Makefile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7c56037..9214784 100644 --- a/Makefile +++ b/Makefile @@ -26,12 +26,35 @@ SRCS := ${SRCS_DIR}c_bsdsetsid.S OBJS = ${SRCS:.S=.o} -AS := yasm -ASFLAGS := -felf64 +AS = yasm +ASFLAGS = -felf64 ASFLAGS += -pgas +ASFLAGS += -gdwarf2 + +CC = cc LD := ld LDFLAGS := -melf_x86_64 +LDFLAGS += --eh-frame-hdr +LDFLAGS += -dynamic-linker +LDFLAGS += /libexec/ld-elf.so.1 +LDFLAGS += --hash-style=both +LDFLAGS += --enable-new-dtags +LDPOST := /usr/lib/crt1.o +LDPOST += /usr/lib/crti.o +LDPOST += /usr/lib/crtbegin.o +LDPOST += -L/usr/lib +LDPOST += -lgcc +LDPOST += --as-needed +LDPOST += -lgcc_s +LDPOST += --no-as-needed +LDPOST += -lc +LDPOST += -lgcc +LDPOST += --as-needed +LDPOST += -lgcc_s +LDPOST += --no-as-needed +LDPOST += /usr/lib/crtend.o +LDPOST += /usr/lib/crtn.o NAME := bsdsetsid @@ -43,7 +66,8 @@ RM := rm -f ${AS} ${ASFLAGS} -o ${.TARGET} ${.IMPSRC} ${NAME}: ${OBJS} - ${LD} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + ${LD} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${LDPOST} + # ${CC} -v -o ${.TARGET} ${.ALLSRC} all: ${NAME} -- cgit v1.2.3