4 -include ../../Makefile.Version.cfg
\r
5 -include Makefile.BuildNum
\r
14 KERNEL_SRC = ../../KernelLand/Kernel/
\r
15 LDACESS_SRC = ../../Usermode/Libraries/ld-acess.so_src/
\r
17 # - Kernel objects (from KernelLand/Kernel)
\r
18 KERNEL_OBJ := logging.o adt.o lib.o debug.o messages.o drvutil_disk.o drvutil_video.o memfs_helpers.o
\r
19 KERNEL_OBJ += mutex.o semaphore.o rwlock.o workqueue.o events.o
\r
20 #KERNEL_OBJ += libc.o
\r
21 KERNEL_OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o
\r
22 KERNEL_OBJ += vfs/nodecache.o vfs/mount.o vfs/memfile.o vfs/select.o
\r
23 KERNEL_OBJ += vfs/fs/root.o vfs/fs/devfs.o
\r
24 KERNEL_OBJ += drv/fifo.o drv/proc.o drv/dgram_pipe.o
\r
25 KERNEL_OBJ += drv/vterm.o drv/vterm_font.o drv/vterm_output.o drv/vterm_input.o drv/vterm_termbuf.o
\r
26 KERNEL_OBJ += drv/vterm_vt100.o drv/vterm_2d.o
\r
27 KERNEL_OBJ += drv/pty.o
\r
28 # - Native (unsullied) objects
\r
29 N_OBJ := main.o net_wrap.o
\r
30 # - Local objects (use the kernel includes)
\r
31 OBJ := helpers.o threads.o threads_glue.o server.o syscalls.o time.o
\r
32 OBJ += video.o keyboard.o mouse.o nativefs.o vfs_handle.o ui_sdl.o
\r
34 OBJ += net.o syscall_getpath.o
\r
36 BUILDINFO_OBJ := obj-$(PLATFORM)/buildinfo.o
\r
37 BUILDINFO_SRC := $(BUILDINFO_OBJ:%.o=%.c)
\r
39 OBJ := $(addprefix obj-$(PLATFORM)/,$(OBJ))
\r
40 N_OBJ := $(addprefix obj-$(PLATFORM)/,$(N_OBJ))
\r
41 K_OBJ := $(addprefix $(KERNEL_SRC)obj-native-$(PLATFORM)/,$(KERNEL_OBJ))
\r
43 DEPFILES = $(filter %.o,$(OBJ) $(N_OBJ) $(K_OBJ))
\r
44 DEPFILES := $(DEPFILES:%=%.dep)
\r
46 KCPPFLAGS = -I include/ -I $(KERNEL_SRC)include/ -I$(LDACESS_SRC)include_exp/ -D KERNEL_VERSION=${ACESS_VERSION}
\r
47 CFLAGS += -Wall -g -std=gnu99
\r
48 CPPFLAGS += $(shell sdl-config --cflags) -I /usr/include/
\r
49 LDFLAGS += $(shell sdl-config --libs) -g -Wl,--defsym,__buildnum=$(BUILD_NUM)
\r
50 LDFLAGS += -Wl,-Map,obj-$(PLATFORM)/Map.txt
\r
52 ifeq ($(PLATFORM),win)
\r
53 BIN := ../AcessKernel.exe
\r
54 LDFLAGS += -lws2_32 -lpthread
\r
56 ifeq ($(PLATFORM),lin)
\r
57 BIN := ../AcessKernel
\r
59 LDFLAGS += -lpthread
\r
67 $(RM) $(BIN) $(OBJ) $(N_OBJ) $(K_OBJ) $(DEPFILES)
\r
69 $(BIN): $(OBJ) $(N_OBJ) $(K_OBJ) $(BUILDINFO_OBJ)
\r
71 @$(CC) -o $@ $(N_OBJ) $(LDFLAGS) $(K_OBJ) $(OBJ) $(BUILDINFO_OBJ)
\r
72 @echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum
\r
74 $(OBJ): obj-$(PLATFORM)/%.o: %.c
\r
79 $(K_OBJ): $(KERNEL_SRC)obj-native-$(PLATFORM)/%.o: $(KERNEL_SRC)%.c
\r
82 @$(CC) -ffreestanding -c $< -o $@ $(CFLAGS) $(KCPPFLAGS) $(CPPFLAGS) -MMD -MP -MF
[email protected]\r
85 $(N_OBJ): obj-$(PLATFORM)/%.o: %.c
\r
90 $(BUILDINFO_SRC): $(filter-out $(BUILDINFO_OBJ), $(OBJ)) Makefile
\r
92 $(eval _GITHASH=$(shell (git log -n 1 | head -n 1 | awk '{print $$2}') 2>/dev/null || echo UNK))
\r
93 $(eval _GITCHANGED=$(shell (git status --porcelain | grep -c '^ M ') 2>/dev/null || echo UNK))
\r
94 $(eval _HOSTNAME=$(shell hostname --fqdn 2>/dev/null || hostname || echo UNK))
\r
95 @echo "const char gsKernelVersion[] = \"$(ACESS_VERSION)\";" >> $@
\r
96 @echo "const char gsGitHash[] = \"$(_GITHASH)\";" >> $@
\r
97 @echo "const char gsBuildInfo[] = \"AcessNative $(ACESS_VERSION) $(ARCH)-$(PLATFORM)\\\\r\\\\n\"" >> $@
\r
98 @echo " \"Build $(_HOSTNAME):$(BUILD_NUM) Git $(_GITHASH) - $(_GITCHANGED) modified\";" >> $@
\r
99 @echo "const int giBuildNumber = $(BUILD_NUM);" >> $@
\r
100 $(BUILDINFO_OBJ): $(BUILDINFO_SRC)
\r
102 @$(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS)
\r
104 -include $(DEPFILES)
\r