mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add makefile targets for installing sysroot base headers.
This commit is contained in:
parent
9d5c3f1882
commit
82035e87da
3 changed files with 28 additions and 6 deletions
3
Makefile
3
Makefile
|
@ -49,6 +49,9 @@ all: $(INITRD)
|
||||||
suball:
|
suball:
|
||||||
(for D in $(MODULES); do ($(MAKE) all $(MFLAGS) --directory $$D && $(MAKE) install $(MFLAGS) --directory $$D) || exit $?; done)
|
(for D in $(MODULES); do ($(MAKE) all $(MFLAGS) --directory $$D && $(MAKE) install $(MFLAGS) --directory $$D) || exit $?; done)
|
||||||
|
|
||||||
|
sysroot-base-headers:
|
||||||
|
(for D in libmaxsi sortix; do ($(MAKE) install-headers $(MFLAGS) --directory $$D) || exit $?; done)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(SYSROOT)
|
rm -rf $(SYSROOT)
|
||||||
rm -f $(INITRD)
|
rm -f $(INITRD)
|
||||||
|
|
|
@ -192,6 +192,9 @@ BINS=libc.a libg.a libmaxsi.a libmaxsi-sortix.a $(CRTOBJ)
|
||||||
|
|
||||||
all: $(BINS)
|
all: $(BINS)
|
||||||
|
|
||||||
|
.PHONY: all headers clean install install-include-dirs install-headers \
|
||||||
|
install-lib-dirs install-libs
|
||||||
|
|
||||||
libmaxsi.a: $(OBJS)
|
libmaxsi.a: $(OBJS)
|
||||||
ar rcs libmaxsi.a $(OBJS)
|
ar rcs libmaxsi.a $(OBJS)
|
||||||
|
|
||||||
|
@ -257,12 +260,20 @@ clean:
|
||||||
rm -rf sortix $(HEADERDIRS)
|
rm -rf sortix $(HEADERDIRS)
|
||||||
|
|
||||||
# Installation into sysroot
|
# Installation into sysroot
|
||||||
install:
|
install: install-headers install-libs
|
||||||
mkdir -p $(SYSROOT)/usr/lib
|
|
||||||
for F in $(BINS); do cp -P $$F $(SYSROOT)/usr/lib || exit $?; done
|
install-include-dirs: headers
|
||||||
for D in $(UNPROCHEADERDIRS); do mkdir -p $(SYSROOT)/usr/$$D || exit $?; done
|
|
||||||
for SRC in $(HEADERS); do DEST=`echo $$SRC | sed 's/preproc/include/'`; cp $$SRC $(SYSROOT)/usr/$$DEST || exit $?; done
|
|
||||||
mkdir -p $(SYSROOT)/usr/include
|
mkdir -p $(SYSROOT)/usr/include
|
||||||
|
for D in $(UNPROCHEADERDIRS); do mkdir -p $(SYSROOT)/usr/$$D || exit $?; done
|
||||||
|
|
||||||
|
install-headers: install-include-dirs headers
|
||||||
|
for SRC in $(HEADERS); do DEST=`echo $$SRC | sed 's/preproc/include/'`; cp $$SRC $(SYSROOT)/usr/$$DEST || exit $?; done
|
||||||
|
|
||||||
|
install-lib-dirs: all
|
||||||
|
mkdir -p $(SYSROOT)/usr/lib
|
||||||
|
|
||||||
|
install-libs: install-lib-dirs all
|
||||||
|
for F in $(BINS); do cp -P $$F $(SYSROOT)/usr/lib || exit $?; done
|
||||||
touch deleteme.cpp
|
touch deleteme.cpp
|
||||||
g++ $(CPUFLAGS) -c deleteme.cpp -o deleteme.o
|
g++ $(CPUFLAGS) -c deleteme.cpp -o deleteme.o
|
||||||
for F in libgcc.so libm.so libstdc++.so; do ld $(CPULDFLAGS) -shared deleteme.o -o $(SYSROOT)/usr/lib/$$F; done
|
for F in libgcc.so libm.so libstdc++.so; do ld $(CPULDFLAGS) -shared deleteme.o -o $(SYSROOT)/usr/lib/$$F; done
|
||||||
|
|
|
@ -153,6 +153,10 @@ JSOBJS:=$(subst .o,-js.o,$(OBJS))
|
||||||
|
|
||||||
all: sortix.bin
|
all: sortix.bin
|
||||||
|
|
||||||
|
.PHONY: all headers clean install install-include-dirs install-headers
|
||||||
|
|
||||||
|
headers:
|
||||||
|
|
||||||
# jssortix compilation
|
# jssortix compilation
|
||||||
|
|
||||||
jssortix: jssortix.bin
|
jssortix: jssortix.bin
|
||||||
|
@ -192,10 +196,14 @@ clean:
|
||||||
for D in $(DIRS); do rm -f $$D/*.o $$D/*.bin $$D/*.out $$D/*.tmp; done
|
for D in $(DIRS); do rm -f $$D/*.o $$D/*.bin $$D/*.out $$D/*.tmp; done
|
||||||
|
|
||||||
# Installation into sysroot
|
# Installation into sysroot
|
||||||
install:
|
install: install-headers
|
||||||
|
|
||||||
|
install-include-dirs: headers
|
||||||
for DIR in $(HEADERDIRS); do \
|
for DIR in $(HEADERDIRS); do \
|
||||||
mkdir -p $(SYSROOT)/usr/$$DIR; \
|
mkdir -p $(SYSROOT)/usr/$$DIR; \
|
||||||
done
|
done
|
||||||
|
|
||||||
|
install-headers: install-include-dirs headers
|
||||||
for FILE in $(HEADERS); do \
|
for FILE in $(HEADERS); do \
|
||||||
cp $$FILE $(SYSROOT)/usr/$$FILE; \
|
cp $$FILE $(SYSROOT)/usr/$$FILE; \
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue