SRCFILES = $(OBJ:%.o.$(ARCH)=%.c)
SRCFILES := $(SRCFILES:%.ao.$(ARCH)=%.asm)
-.PHONY: all clean apidoc
+.PHONY: all clean install apidoc
all: $(BIN)
clean:
@$(RM) $(BIN) $(BIN).dsm ../Map.$(ARCH).txt LineCounts.$(ARCH).txt $(OBJ) $(DEPFILES)
+install: $(BIN)
+ $(xCP) $(BIN) $(DISTROOT)
+
apidoc:
doxygen Doxyfile.api
@echo --- LD -o $(BIN)
@$(LD) $(LDFLAGS) -o $(BIN) $(OBJ) $(MODS) -Map ../Map.$(ARCH).txt
@objdump $(BIN) -D > $(BIN).dsm
- $(xCP) $(BIN) $(DISTROOT)
@wc -l $(SRCFILES) > LineCounts.$(ARCH).txt
@echo BUILD_NUM = `calc $(BUILD_NUM)+1` > Makefile.BuildNum
-BUILD_NUM = 1074
+BUILD_NUM = 1078
tInodeCache *prev = (tInodeCache*) &gVFS_InodeCache;
tCachedInode *ent, *next;
- cache = Inode_int_GetFSCache(Handle);
+ // Find the cache
+ for(
+ cache = gVFS_InodeCache;
+ cache && cache->Handle < Handle;
+ prev = cache, cache = cache->Next
+ );
if(!cache) return;
// Search Cache
#
# Acess2 Core Makefile
#
+# (Oh man! This is hacky, but beautiful at the same time, much like the
+# rest of Acess)
.PHONY: all clean
+SUBMAKE = $(MAKE) --no-print-directory
+
MODULES = FS_Ext2 FDD BochsGA IPStack NE2000 USB
USRLIBS = ld-acess.so libacess.so libgcc.so libc.so
USRAPPS = init login CLIShell cat ls mount ifconfig
-all:
- @echo === Filesystem && $(MAKE) all --no-print-directory -C Usermode/Filesystem
- @for mod in $(MODULES); do \
- (echo === Module: $$mod && $(MAKE) all --no-print-directory -C Modules/$$mod) \
- done
-
- @echo === Kernel
- @$(MAKE) all --no-print-directory -C Kernel
-
- @for lib in $(USRLIBS); do \
- (echo === User Library: $$lib && $(MAKE) all --no-print-directory -C Usermode/Libraries/`echo $$lib`_src) \
- done
-
- @for app in $(USRAPPS); do \
- (echo === User Application: $$app && $(MAKE) all --no-print-directory -C Usermode/Applications/`echo $$app`_src) \
- done
-
-clean:
-# @$(MAKE) clean --no-print-directory -C Usermode/Filesystem
- @for mod in $(MODULES); do \
- ($(MAKE) clean --no-print-directory -C Modules/$$mod) \
- done
-
- @make clean --no-print-directory -C Kernel/
-
- @for lib in $(USRLIBS); do \
- ($(MAKE) clean --no-print-directory -C Usermode/Libraries/`echo $$lib`_src) \
- done
-
- @for app in $(USRAPPS); do \
- ($(MAKE) clean --no-print-directory -C Usermode/Applications/`echo $$app`_src) \
- done
+ALL_MODULES = $(addprefix all-,$(MODULES))
+ALL_USRLIBS = $(addprefix all-,$(USRLIBS))
+ALL_USRAPPS = $(addprefix all-,$(USRAPPS))
+CLEAN_MODULES = $(addprefix clean-,$(MODULES))
+CLEAN_USRLIBS = $(addprefix clean-,$(USRLIBS))
+CLEAN_USRAPPS = $(addprefix clean-,$(USRAPPS))
+INSTALL_MODULES = $(addprefix install-,$(MODULES))
+INSTALL_USRLIBS = $(addprefix install-,$(USRLIBS))
+INSTALL_USRAPPS = $(addprefix install-,$(USRAPPS))
+
+.PHONY: all clean install \
+ $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS) \
+ $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS) \
+ $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
+
+all: $(ALL_MODULES) all-Kernel $(ALL_USRLIBS) $(ALL_USRAPPS)
+clean: $(CLEAN_MODULES) clean-Kernel $(CLEAN_USRLIBS) $(CLEAN_USRAPPS)
+install: $(INSTALL_MODULES) install-Kernel $(INSTALL_USRLIBS) $(INSTALL_USRAPPS)
+
+
+$(ALL_MODULES): all-%:
+ @echo === Module: $* && $(SUBMAKE) all -C Modules/$*
+all-Kernel:
+ @echo === Kernel && $(SUBMAKE) all -C Kernel
+$(ALL_USRLIBS): all-%:
+ @echo === User Library: $* && $(SUBMAKE) all -C Usermode/Libraries/$*_src
+$(ALL_USRAPPS): all-%:
+ @echo === User Application: $* && $(SUBMAKE) all -C Usermode/Applications/$*_src
+
+$(CLEAN_MODULES): clean-%:
+ @$(SUBMAKE) clean -C Modules/$*
+clean-Kernel:
+ @$(SUBMAKE) clean -C Kernel
+$(CLEAN_USRLIBS): clean-%:
+ @$(SUBMAKE) clean -C Usermode/Libraries/$*_src
+$(CLEAN_USRAPPS): clean-%:
+ @$(SUBMAKE) clean -C Usermode/Applications/$*_src
+
+$(INSTALL_MODULES): install-%:
+ @$(SUBMAKE) install -C Modules/$*
+install-Kernel:
+ @$(SUBMAKE) install -C Kernel
+$(INSTALL_USRLIBS): install-%:
+ @$(SUBMAKE) install -C Usermode/Libraries/$*_src
+$(INSTALL_USRAPPS): install-%:
+ @$(SUBMAKE) install -C Usermode/Applications/$*_src
clean:
$(RM) $(BIN) $(BIN).dsm $(KOBJ) $(OBJ) $(DEPFILES)
+install: $(BIN)
+ $(xCP) $(BIN) $(DISTROOT)/Modules/$(NAME).kmd
+
$(BIN): $(OBJ)
@echo --- $(LD) -o $@
@$(LD) -T ../link.ld -shared -nostdlib -o $@ $(OBJ)
-# @$(LD) -shared -nostdlib -o $@ $(OBJ)
@$(OBJDUMP) -d $(BIN) > $(BIN).dsm
- $(xCP) $@ $(DISTROOT)/Modules/$(NAME).kmd
@echo --- $(LD) -o $(KOBJ)
@$(CC) -Wl,-r -nostdlib -o $(KOBJ) $(OBJ)
-include ../Makefile.cfg\r
\r
CPPFLAGS += -I./include\r
-CFLAGS += -Wall -fno-builtin -fno-stack-protector\r
-LDFLAGS += \r
\r
BIN = ../CLIShell\r
-COBJ = main.o lib.o\r
+OBJ = main.o lib.o\r
\r
-.PHONY : all clean\r
-\r
-all: $(BIN)\r
-\r
-clean:\r
- $(RM) $(COBJ) $(BIN) $(BIN).dsm Map.txt\r
-\r
-$(BIN): $(COBJ)\r
- @echo --- $(LD) -o $@\r
- @$(LD) $(LDFLAGS) -o $@ $(COBJ) -Map Map.txt\r
- objdump -d $(BIN) > $(BIN).dsm\r
- $(xCP) $(BIN) $(DISTROOT)/Bin/\r
-\r
-$(COBJ): %.o: %.c\r
- @echo --- GCC -o $@\r
- @$(CC) $(CFLAGS) -c $? -o $@\r
+-include ../Makefile.tpl\r
--- /dev/null
+# Acess2 - Application Template Makefile
+#
+#
+
+CFLAGS += -Wall -fno-builtin -fno-stack-protector
+LDFLAGS +=
+
+.PHONY : all clean install
+
+all: $(BIN)
+
+clean:
+ @$(RM) $(OBJ) $(BIN) $(BIN).dsm Map.txt
+
+install: $(BIN)
+ $(xCP) $(BIN) $(DISTROOT)/Bin/
+
+$(BIN): $(OBJ)
+ @echo --- $(LD) -o $@
+ @$(LD) $(LDFLAGS) -o $@ $(OBJ) -Map Map.txt
+ @objdump -d $(BIN) > $(BIN).dsm
+
+$(OBJ): %.o: %.c
+ @echo --- GCC -o $@
+ @$(CC) $(CFLAGS) $(CPPFLAGS) -c $? -o $@
-include ../Makefile.cfg
-COBJ = main.o
+OBJ = main.o
BIN = ../cat
-CFLAGS += -Wall -fno-builtin -fno-stack-protector
-LDFLAGS +=
-
-.PHONY : all clean
-
-all: $(BIN)
-
-$(BIN): $(COBJ)
- @echo --- $(LD) -o $@
- @$(LD) $(LDFLAGS) -o $@ $(COBJ) -Map Map.txt
- objdump -d $(BIN) > $(BIN).dsm
- $(xCP) $(BIN) $(DISTROOT)/Bin/
-
-clean:
- $(RM) $(COBJ) $(BIN) $(BIN).dsm Map.txt
-
-$(COBJ): %.o: %.c
- @echo --- GCC -o $@
- @$(CC) $(CFLAGS) -c $? -o $@
+-include ../Makefile.tpl
\r
-include ../Makefile.cfg\r
\r
-COBJ = main.o
+OBJ = main.o
BIN = ../ifconfig\r
\r
-CFLAGS += -Wall -fno-builtin -fno-stack-protector\r
-LDFLAGS += \r
-\r
-.PHONY : all clean\r
-\r
-all: $(BIN)\r
-\r
-$(BIN): $(COBJ)\r
- @echo --- $(LD) -o $@\r
- @$(LD) $(LDFLAGS) -o $@ $(COBJ) -Map Map.txt\r
- @objdump -d $(BIN) > $(BIN).dsm\r
- $(xCP) $(BIN) $(DISTROOT)/Bin/
-\r
-clean:\r
- @$(RM) $(COBJ) $(BIN) $(BIN).dsm Map.txt
-\r
-$(COBJ): %.o: %.c\r
- @echo --- GCC -o $@
- @$(CC) $(CFLAGS) -c $? -o $@
+-include ../Makefile.tpl
\r
BIN = ../init
OBJ = main.o
-.PHONY: all clean
-
-all: $(BIN)
-
-clean:
- $(RM) $(BIN) $(OBJ) $(BIN).dsm
-
-$(BIN): $(OBJ) Makefile
- @echo --- ld -o $(BIN)
- @$(LD) $(LDFLAGS) $(OBJ) -o $(BIN)
- $(OBJDUMP) -d $(BIN) > $(BIN).dsm
- $(xCP) $(BIN) $(DISTROOT)/SBin/
-
-%.o: %.c
- @echo --- $(CC) -o $@
- @$(CC) $(CFLAGS) -c $< -o $@
+-include ../Makefile.tpl
DBTYPE = tpl
-CPPFLAGS +=
-CFLAGS += -fno-stack-protector -Wall -Werror -O3 $(CPPFLAGS)
-LDFLAGS += -lgcc -lc
-
OBJ = main.o database_$(DBTYPE).o
BIN = ../login
-.PHONY: all clean
-
-all: $(BIN)
-
-clean:
- $(RM) $(BIN) $(OBJ) login.dsm
-
-$(BIN): $(OBJ)
- @echo --- $(LD) -o $@
- @$(LD) $(LDFLAGS) $(OBJ) -o $@
- $(xCP) $(BIN) $(DISTROOT)/SBin/
- objdump -d $(BIN) > login.dsm
-
-%.o: %.c Makefile
- @echo --- $(CC) -o $@
- @$(CC) $(CFLAGS) -c $< -o $@
+-include ../Makefile.tpl
-include ../Makefile.cfg
-COBJ = main.o
+OBJ = main.o
BIN = ../ls
-CFLAGS += -Wall -fno-builtin
-LDFLAGS +=
-
-.PHONY : all clean
-
-all: $(BIN)
-
-$(BIN): $(COBJ)
- @echo --- $(LD) -o $@
- @$(LD) $(LDFLAGS) -o $@ $(COBJ) -Map Map.txt
- objdump -d $(BIN) > $(BIN).dsm
- $(xCP) $(BIN) $(DISTROOT)/Bin/
-
-clean:
- $(RM) $(COBJ) $(BIN) $(BIN).dsm Map.txt
-
-$(COBJ): %.o: %.c
- @echo --- GCC -o $@
- @$(CC) $(CFLAGS) -c $? -o $@
-
+-include ../Makefile.tpl
-include ../Makefile.cfg
-COBJ = main.o
+OBJ = main.o
BIN = ../mount
-CFLAGS += -Wall -fno-builtin -fno-stack-protector
-LDFLAGS +=
-
-.PHONY : all clean
-
-all: $(BIN)
-
-$(BIN): $(COBJ)
- @echo --- $(LD) -o $@
- @$(LD) $(LDFLAGS) -o $@ $(COBJ) -Map Map.txt
- objdump -d $(BIN) > $(BIN).dsm
- $(xCP) $(BIN) $(DISTROOT)/Bin/
-
-clean:
- $(RM) $(COBJ) $(BIN) Map.txt $(BIN).dsm
-
-$(COBJ): %.o: %.c
- @echo --- GCC -o $@
- @$(CC) $(CFLAGS) -c $? -o $@
+-include ../Makefile.tpl
$(FILES):
$(xCP) $< $(DISTROOT)/$@
+
+force: ;
LDFLAGS = -T link.ld -Map map.txt -Bstatic\r
\r
\r
-.PHONY: all clean\r
+.PHONY: all clean install\r
\r
all: $(BIN)\r
\r
clean:\r
$(RM) $(BIN) $(AOBJ) $(COBJ) ld-acess.dmp ld-acess.dsm link.txt map.txt\r
\r
+install: $(BIN)\r
+ $(xCP) $(BIN) $(DISTROOT)/Libs/\r
+\r
$(BIN): $(AOBJ) $(COBJ)\r
@echo --- $(LD) -shared -o $@\r
@$(LD) $(LDFLAGS) -o $(BIN) $(AOBJ) $(COBJ) > link.txt\r
$(OBJDUMP) -x $(BIN) > ld-acess.dmp\r
- $(OBJDUMP) -d $(BIN) > ld-acess.dsm\r
- $(xCP) $(BIN) $(DISTROOT)/Libs/
+ $(OBJDUMP) -d $(BIN) > ld-acess.dsm
\r
$(COBJ): %.o: %.c\r
@echo $(CC) -o $@\r
OBJ = core.ao vfs.ao mm.ao
BIN = ../libacess.so
-.PHONY: all clean
+.PHONY: all clean install
all: $(BIN)
clean:
$(RM) $(BIN) $(OBJ)
+install:
+ $(xCP) $(BIN) $(DISTROOT)/Libs
+
$(BIN): $(OBJ)
@echo --- $(LD) -shared -o $@
@$(LD) $(LDFLAGS) -o $(BIN) $(OBJ)
@$(STRIP) $(BIN)
- $(xCP) $(BIN) $(DISTROOT)/Libs
%.ao: %.asm syscalls.inc.asm
@echo $(AS) -o $@
# signals.o\r
BIN = ../libc.so.1\r
\r
-.PHONY: all clean\r
+.PHONY: all clean install\r
\r
all: $(BIN)\r
\r
clean:\r
$(RM) $(BIN) ../libc.so $(OBJ) $(DEPFILES) libc.so.1.dsm libc.so.1.dmp map.txt\r
\r
+install: $(BIN)\r
+ $(xCP) ../libc.so.1 $(DISTROOT)/Libs/\r
+\r
# Core C Library\r
$(BIN): $(OBJ)\r
@echo --- ld -shared -o $@\r
@$(OBJDUMP) -d $@ > libc.so.1.dsm\r
@$(OBJDUMP) -x -r -R $@ > libc.so.1.dmp\r
cp ../libc.so.1 ../libc.so\r
- $(xCP) ../libc.so.1 $(DISTROOT)/Libs/\r
\r
# C Runtime 0\r
../crt0.o: crt0.asm\r
CFLAGS += -Wall -Werror
LDFLAGS += -soname libgcc.so
-.PHONY: all clean
+.PHONY: all clean install
all: $(BIN)
clean:
$(RM) $(BIN) $(OBJS) libgcc.so.dsm
+install: $(BIN)
+ $(xCP) $(BIN) $(DISTROOT)/Libs
+
$(BIN): $(OBJS)
@echo -- ld -o $@
@$(LD) $(LDFLAGS) -o $(BIN) $(OBJS)
@$(OBJDUMP) -d $(BIN) > libgcc.so.dsm
- $(xCP) $(BIN) $(DISTROOT)/Libs
$(OBJS): %.o: %.c
@echo -- gcc -o $@