DEPFILES = $(filter %.o,$(OBJ) $(N_OBJ) $(K_OBJ))\r
DEPFILES := $(DEPFILES:%=%.dep)\r
\r
-CPPFLAGS += -I include/ -I $(KERNEL_SRC)include/\r
+KCPPFLAGS = -I include/ -I $(KERNEL_SRC)include/\r
CFLAGS += -Wall -g -std=gnu99\r
LDFLAGS += -lSDL -lSDLmain -g -Wl,--defsym,__buildnum=$(BUILD_NUM)\r
\r
$(OBJ): obj-$(PLATFORM)/%.o: %.c\r
@mkdir -p $(dir $@)\r
@echo [CC] -o $@\r
- @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)\r
+ @$(CC) -c $< -o $@ $(CFLAGS) $(KCPPFLAGS) $(CPPFLAGS)\r
\r
$(K_OBJ): $(KERNEL_SRC)obj-native-$(PLATFORM)/%.o: $(KERNEL_SRC)%.c\r
@mkdir -p $(dir $@)\r
@echo [CC] -o $@\r
- @$(CC) -c $< -o $@ $(CFLAGS) $(CPPFLAGS)\r
+ $(CC) -ffreestanding -c $< -o $@ $(CFLAGS) $(KCPPFLAGS) $(CPPFLAGS)\r
\r
\r
$(N_OBJ): obj-$(PLATFORM)/%.o: %.c\r
@mkdir -p $(dir $@)\r
@echo [CC] -o $@\r
- @$(CC) -c $< -o $@ $(CFLAGS)\r
+ @$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)\r
\r
$(BUILDINFO_SRC): $(filter-out $(BUILDINFO_OBJ), $(OBJ)) Makefile\r
@echo "" > $@\r
- $(eval _GITHASH=$(shell git log -n 1 | head -n 1 | awk '{print $$2}'))\r
- $(eval _GITCHANGED=$(shell git status --porcelain | grep -c '^ M '))\r
+ $(eval _GITHASH=$(shell (git log -n 1 | head -n 1 | awk '{print $$2}') || echo UNK))\r
+ $(eval _GITCHANGED=$(shell (git status --porcelain | grep -c '^ M ') || echo UNK))\r
@echo "const char gsKernelVersion[] = \"$(ACESS_VERSION)\";" >> $@\r
@echo "const char gsGitHash[] = \"$(_GITHASH)\";" >> $@\r
@echo "const char gsBuildInfo[] = \"Acess2 v$(KERNEL_VERSION) $(ARCH)-$(PLATFORM)\\\\r\\\\n\"" >> $@\r