targets=deforaos-gcc,deforaos-gcc.specs,ldso,libgcc,tracer,uname
cppflags_force=-isystem ../include -isystem ../include/dl -isystem ../include/math -isystem ../include/pthread -isystem ../include/rt -isystem ../include/socket
as=$(CC)
cflags_force=-ffreestanding -fPIC
cflags=-W -Wall -g -O2 -fstack-protector
asflags_force=$(CFLAGSF)
asflags=$(CFLAGS) -c
ldflags=-Wl,-z,relro -Wl,-z,now
dist=Makefile,deforaos-gcc.in,deforaos-gcc.specs.in,ldso.sh,libgcc.sh,subst.sh,pkgconfig.sh,tracer-analyze.h,tracer-syscalls.h

#targets
[deforaos-gcc]
type=script
script=./subst.sh
depends=deforaos-gcc.in,subst.sh,../config.sh
install=$(PREFIX)/bin

[deforaos-gcc.specs]
type=script
script=./subst.sh
depends=deforaos-gcc.specs.in,subst.sh,../config.sh
install=$(PREFIX)/lib/gcc

[ldso]
type=script
script=./ldso.sh
depends=ldso.sh
install=$(PREFIX)/lib
phony=1

[libgcc]
type=script
script=./libgcc.sh
depends=libgcc.sh
install=$(PREFIX)/lib
phony=1

[tracer]
type=plugin
sources=tracer-analyze.c,tracer-syscalls.S

[uname]
type=binary
sources=uname.c
ldflags=-nostdlib -L$(OBJDIR)../src -Wl,-rpath,$(OBJDIR)../src $(OBJDIR)../src/start.o $(OBJDIR)../src/crti.o $(OBJDIR)../src/crtbegin.o -lc $(OBJDIR)../src/ssp/libssp.a $(OBJDIR)../src/crtend.o $(OBJDIR)../src/crtn.o `$(CC) -print-libgcc-file-name` -pie

#sources
[tracer-analyze.c]
depends=tracer-syscalls.h,../src/syscalls.h,tracer-analyze.h

[tracer-syscalls.S]
depends=tracer-analyze.h
