Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use a different toolchain and fix compiler warnings #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ebfc/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Makefile for ebfc

CC = gcc
CFLAGS = -Wall -Wextra -Wno-missing-field-initializers
CC ?= gcc
CFLAGS ?= -Wall -Wextra -Wno-missing-field-initializers
AR ?= ar
ARFLAGS ?= crs

# The main program.

Expand All @@ -15,7 +17,7 @@ brainfuck.o: brainfuck.c elfparts.h ebfc.h
libelfparts.a: elfparts.o \
ehdr.o phdrtab.o shdrtab.o progbits.o \
strtab.o symtab.o hash.o rel.o got.o dynamic.o
ar crs libelfparts.a $^
$(AR) $(ARFLAGS) libelfparts.a $^

elfparts.o: elfparts.c elfparts.h elfpartsi.h
ehdr.o: ehdr.c elfparts.h elfpartsi.h
Expand Down
4 changes: 2 additions & 2 deletions elfls/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for elfls

CC = gcc
CFLAGS = -Wall -Wextra -I../elfrw
CC ?= gcc
CFLAGS ?= -Wall -Wextra -I../elfrw

elfls: elfls.c ../elfrw/libelfrw.a

Expand Down
6 changes: 3 additions & 3 deletions elfls/elfls.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ static int ldepls = FALSE; /* TRUE = show libraries */
static int dostrs = TRUE; /* TRUE = show entry strings */
static int dooffs = TRUE; /* TRUE = show file offsets */

static char sizefmt[8]; /* num digits to show sizes */
static char addrfmt[8]; /* num digits to show addresses */
static char offsetfmt[8]; /* num digits to show offsets */
static char sizefmt[16]; /* num digits to show sizes */
static char addrfmt[16]; /* num digits to show addresses */
static char offsetfmt[16]; /* num digits to show offsets */
static int outwidth; /* maximum width of output */

/* The error-reporting function.
Expand Down
8 changes: 5 additions & 3 deletions elfrw/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Makefile for libelfrw.a

CC = gcc
CFLAGS = -Wall -Wextra -O3
CC ?= gcc
CFLAGS ?= -Wall -Wextra -O3
AR ?= ar
ARFLAGS ?= crs

LIBOBJS = elfrw.o elfrw_dyn.o elfrw_ehdr.o elfrw_phdr.o elfrw_rel.o \
elfrw_shdr.o elfrw_sym.o elfrw_ver.o

libelfrw.a: $(LIBOBJS)
ar crs $@ $^
$(AR) $(ARFLAGS) $@ $^

elfrw.o: elfrw.c elfrw.h elfrw_int.h
elfrw_dyn.o: elfrw_dyn.c elfrw_int.h
Expand Down
7 changes: 4 additions & 3 deletions elftoc/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Makefile for elftoc

CC = gcc
CFLAGS = -Wall -Wextra
LDFLAGS = -Wall -Wextra
CC ?= gcc
CFLAGS ?= -Wall -Wextra
LDFLAGS ?= -Wall -Wextra
CPP ?= $(CC) -E

OBJS = gen.o names.o address.o readelf.o shdrtab.o phdrtab.o dynamic.o \
pieces.o outbase.o outitems.o outelf64.o outelf32.o out.o elftoc.o
Expand Down
4 changes: 2 additions & 2 deletions infect/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for infect

CC = gcc
CFLAGS = -Wall -Wextra
CC ?= gcc
CFLAGS ?= -Wall -Wextra

infect: infect.c

Expand Down
6 changes: 3 additions & 3 deletions objres/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Makefile for objres

CC = gcc
CFLAGS = -Wall -Wextra -I../elfrw
LDFLAGS = -Wall -Wextra
CC ?= gcc
CFLAGS ?= -Wall -Wextra -I../elfrw
LDFLAGS ?= -Wall -Wextra

objres: objres.o ../elfrw/libelfrw.a

Expand Down
4 changes: 2 additions & 2 deletions rebind/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for rebind

CC = gcc
CFLAGS = -Wall -Wextra -I../elfrw
CC ?= gcc
CFLAGS ?= -Wall -Wextra -I../elfrw

rebind: rebind.c ../elfrw/libelfrw.a

Expand Down
4 changes: 2 additions & 2 deletions sstrip/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Makefile for sstrip

CC = gcc
CFLAGS = -Wall -Wextra -I../elfrw
CC ?= gcc
CFLAGS ?= -Wall -Wextra -I../elfrw

sstrip: sstrip.c ../elfrw/libelfrw.a

Expand Down