Skip to content
Snippets Groups Projects
Commit d1ea0ba5 authored by Byron Lathi's avatar Byron Lathi
Browse files

reorganize user programs

parent e6e6a7ca
No related branches found
No related tags found
No related merge requests found
all: summer_img
all: summer_img usercode
cd kernel && $(MAKE)
cp kernel/img .
sudo sh updateimage.sh
clean:
cd kernel && $(MAKE) clean
cd fsdir/Programs/src && $(MAKE) clean
rm -f img
summer_img:
cd kernel && $(MAKE)
cp kernel/img .
sudo sh mkimage.sh
sudo sh updateimage.sh
\ No newline at end of file
sudo sh updateimage.sh
.PHONY: usercode
usercode:
cd fsdir/Programs/src && $(MAKE)
\ No newline at end of file
CFLAGS += -Wall -nostdlib -ffreestanding -m32 -g
CFLAGS += -Wall -nostdlib -ffreestanding -m32 -Ilib
LDFLAGS += -nostdlib -ffreestanding -m32
CC=i686-elf-gcc
AR=i686-elf-ar
SRC = hello exectest read shell ls
......@@ -14,9 +15,15 @@ ALL: $(SRC)
%.o: %.S
$(CC) $(CFLAGS) -c -Wall -o $@ $<
%: %.o syscall.o lib.o
$(CC) $(LDFLAGS) -o $@ $^
%: %.o lib
$(CC) $(LDFLAGS) -o $@ $< -Llib -lc
mv $@ ../bin
clean:
cd lib && $(MAKE) clean
rm -f ../bin/*
rm -f libc.a
.PHONY: lib
lib:
cd lib && $(MAKE)
CFLAGS += -Wall -nostdlib -ffreestanding -m32 -Ilib
LDFLAGS += -nostdlib -ffreestanding -m32
CC=i686-elf-gcc
AR=i686-elf-ar
libc.a: lib.o syscall.o
$(AR) rc $@ $^
rm -rf $^
.PHONY: clean
clean:
rm -rf libc.a
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
#include "syscall.h"
#include "lib.h"
#include <syscall.h>
#include <lib.h>
int main(int argc, char** argv)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment