@@ -40,9 +40,6 @@ INC_NEWLIB=$(INSTALL)/newlib/include
4040CC = $(shell command -v clang-3.8 || command -v clang-3.6)
4141CPP = $(shell command -v clang++-3.8 || command -v clang++-3.6 || command -v clang++)
4242# Set defaults if not defined
43- ifndef LD_INC
44- LD_INC = ld
45- endif
4643ifndef AR_INC
4744 AR_INC = ar
4845endif
@@ -59,7 +56,6 @@ CINCLUDES = -I../api/sys -I$(INC_NEWLIB) -Iinclude -I../api
5956
6057CCOPTS += $(CAPABS ) $(WARNS ) -c -m32 -march=i686 $(CINCLUDES )
6158CPPOPTS += $(CAPABS ) $(WARNS ) -c -m32 -std=c++14 $(INCLUDES ) -D_LIBCPP_HAS_NO_THREADS=1 -DOS_VERSION="\"$(shell git describe --dirty) \""
62- LDOPTS = -nostdlib -melf_i386 -N --eh-frame-hdr --script=linker.ld
6359
6460# Objects
6561# ##################################################
@@ -106,7 +102,7 @@ CRTN_OBJ = crt/crtn.o
106102# ##################################################
107103OS_DEPS = $(OS_OBJECTS:.o=.d )
108104
109- .PHONY : memdisk all debug stripped minimal clean
105+ .PHONY : all stripped minimal debug silent clean
110106
111107# Complete OS build
112108# ##################################################
@@ -118,10 +114,12 @@ all: CAPABS += -O2
118114all : includeos
119115 @echo " \n>>> Built OS-library. Install to '" $(INSTALL ) " ' using 'make install'"
120116
121- stripped : CAPABS += -Os
122- stripped : LDOPTS += -s
117+ stripped : CAPABS += -O2
123118stripped : includeos
124119
120+ minimal : CAPABS += -Os
121+ minimal : includeos
122+
125123# Build like "all" but with debugging output (i.e. the 'debug'-macro) enabled
126124debug-info : CAPABS += -UNO_DEBUG
127125debug-info : CAPABS += -DGSL_THROW_ON_CONTRACT_VIOLATION
@@ -144,31 +142,8 @@ debug-all: includeos test
144142silent : CPPOPTS += -DNO_INFO=1
145143silent : includeos
146144
147- minimal : CPPOPTS += -ffunction-sections -fdata-sections
148- minimal : LDOPTS += --gc-sections
149- minimal : stripped
150-
151145includeos : bootloader multiboot libc++abi.a os.a drivers platforms
152146
153- # Test service
154- # ##################################################
155- LIBS_OBJ = os.a $(LIBCXX ) os.a $(LIBC_OBJ ) $(LIBM_OBJ ) $(LIBGCC )
156-
157-
158- CRTBEGIN_OBJ = $(CRTI_OBJ ) $(INSTALL ) /crt/crtbegin.o
159- CRTEND_OBJ = $(INSTALL ) /crt/crtend.o $(CRTN_OBJ )
160-
161- TEST_OBJ = debug/test_service.o util/service_name.o
162-
163- test_service : CPPOPTS += -DSERVICE_NAME="\"Test Service\""
164- test_service : $(TEST_OBJ ) $(CRTI_OBJ ) $(CRTN_OBJ )
165- @echo " \n>> Linking test service"
166- @echo " \n>> LDOPTS = $( LDOPTS) "
167- touch smalldisk
168- $(LD_INC ) -v $(LDOPTS ) $(CRTBEGIN_OBJ ) $(TEST_OBJ ) $(LIBS_OBJ ) $(CRTEND_OBJ ) -o debug/$@
169-
170- test : test_service
171-
172147# OS libraries
173148# ##################################################
174149# OS
@@ -252,10 +227,7 @@ etags:
252227
253228# Cleanup
254229# ##################################################
255- clean_tests :
256- $(RM ) debug/* .o debug/* .d debug/* .img debug/test_service debug/test_ipv6 debug/test_tcp
257-
258- clean : clean_tests
230+ clean :
259231 $(RM ) $(OS_OBJECTS ) $(CXXABI_OBJ ) $(OS_DEPS ) $(DRIVERS ) $(DRIVERS_DEPS ) $(PLATFORMS ) $(PLATFORMS_DEPS )
260232 $(RM ) os.a libc++abi.a
261233 $(RM ) bootloader apic_boot apic_boot.o boot/multiboot.o
0 commit comments