Mercurial > sos > sos
annotate Makefile @ 103:963bed9f5592
Attempted to set up the syscall handler
author | Jonathan Pevarnek <pevarnj@gmail.com> |
---|---|
date | Mon, 30 May 2011 22:55:19 -0400 |
parents | 6f81e6ae3f64 |
children | 1144f2491a39 |
rev | line source |
---|---|
0 | 1 CROSS_COMPILE=s390x-linux- |
2 AS=$(CROSS_COMPILE)as | |
3 CC=$(CROSS_COMPILE)gcc | |
19
d24d69066fc0
added C++ build support
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
11
diff
changeset
|
4 CXX=$(CROSS_COMPILE)g++ |
0 | 5 LD=$(CROSS_COMPILE)ld |
40
40af39d064fa
Refactor the arch code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
19
diff
changeset
|
6 AR=$(CROSS_COMPILE)ar |
0 | 7 OBJCOPY=$(CROSS_COMPILE)objcopy |
8 | |
9 MAKEFLAGS += -rR --no-print-directory | |
10 CFLAGS=-g -fno-strict-aliasing -fno-builtin -nostdinc -nostdlib -Wall -m64 -I include/ -O2 | |
19
d24d69066fc0
added C++ build support
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
11
diff
changeset
|
11 CXXFLAGS=$(CFLAGS) |
0 | 12 LDFLAGS=-m elf64_s390 |
13 | |
100
d8f21e4a75e3
Added a simple program that is just an infinite loop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
99
diff
changeset
|
14 BINS=sarpn dynamic testFS shell infLoop |
10
68bac03da6ff
a bit of reorganization
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
0
diff
changeset
|
15 |
94
191e99dffd6c
Moved some std.h functions to string.h, worked on a simple version of sprintf
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
86
diff
changeset
|
16 sarpn_OBJS=src/sarpn.o src/std.o src/string.o src/stack.o src/operations.o src/math.o arch/arch.a |
191e99dffd6c
Moved some std.h functions to string.h, worked on a simple version of sprintf
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
86
diff
changeset
|
17 dynamic_OBJS=src/dynamic.o src/std.o src/string.o src/stack.o arch/arch.a |
191e99dffd6c
Moved some std.h functions to string.h, worked on a simple version of sprintf
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
86
diff
changeset
|
18 testFS_OBJS=src/testFS.o src/std.o src/string.o src/fs.o arch/arch.a |
103
963bed9f5592
Attempted to set up the syscall handler
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
101
diff
changeset
|
19 shell_OBJS=src/shell.o src/std.o src/fs.o src/string.o src/stdio.o src/os/scall.o arch/arch.a |
101
6f81e6ae3f64
infLoop takes no arguments, no longer compiles with the architecture files
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
100
diff
changeset
|
20 infLoop_OBJS=src/infLoop.o |
40
40af39d064fa
Refactor the arch code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
19
diff
changeset
|
21 |
83
ca308c8ca41e
beginning of svc support code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
42
diff
changeset
|
22 ARCH_OBJS=arch/io.o arch/cons.o arch/ebcdic.o arch/fba.o arch/ioint.o \ |
ca308c8ca41e
beginning of svc support code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
42
diff
changeset
|
23 arch/svc.o arch/svcint.o |
0 | 24 |
25 .PHONY: all build clean tags | |
26 | |
10
68bac03da6ff
a bit of reorganization
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
0
diff
changeset
|
27 all: $(BINS) loader.bin |
0 | 28 @echo "Image is `stat -c %s sarpn` bytes" |
29 @echo "Loader is `stat -c %s loader.bin` bytes" | |
30 | |
31 clean: | |
10
68bac03da6ff
a bit of reorganization
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
0
diff
changeset
|
32 rm -f $(sarpn_OBJS) |
25
2b19746a4e97
Added stack_destroy, separated programs, added swap operation
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
21
diff
changeset
|
33 rm -f $(dynamic_OBJS) |
51
eda059d74100
Started to librarize (is that a word) the filesystem
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
50
diff
changeset
|
34 rm -f $(testFS_OBJS) |
41
216ad602944f
Makefile: clean should remove all the arch .o files
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
40
diff
changeset
|
35 rm -f $(ARCH_OBJS) |
10
68bac03da6ff
a bit of reorganization
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
0
diff
changeset
|
36 rm -f $(BINS) |
0 | 37 rm -f loader.bin ipl/*.o ipl/*.rto ipl/ipl_ccws.S cscope.out |
38 | |
39 tags: | |
40 cscope -R -b | |
21
7c2adb65ceac
Started working on dynamic memory
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
20
diff
changeset
|
41 ctags -R |
0 | 42 |
10
68bac03da6ff
a bit of reorganization
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
0
diff
changeset
|
43 sarpn: $(sarpn_OBJS) |
0 | 44 $(LD) $(LDFLAGS) -T scripts/linker.script -o $@ $^ |
25
2b19746a4e97
Added stack_destroy, separated programs, added swap operation
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
21
diff
changeset
|
45 dynamic: $(dynamic_OBJS) |
2b19746a4e97
Added stack_destroy, separated programs, added swap operation
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
21
diff
changeset
|
46 $(LD) $(LDFLAGS) -T scripts/linker.script -o $@ $^ |
46
a6be89bc4b04
Moved fs.c to testFS.c
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
45
diff
changeset
|
47 testFS: $(testFS_OBJS) |
35
f806eec33c45
Added a very hacked together (and barely functional) start to a filesystem
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
27
diff
changeset
|
48 $(LD) $(LDFLAGS) -T scripts/linker.script -o $@ $^ |
98
28c230f0700e
Started very early work on the shell, fnameCmp will now return 0 if a null character is reached in one of the strings at the same location as a space in the other
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
97
diff
changeset
|
49 shell: $(shell_OBJS) |
28c230f0700e
Started very early work on the shell, fnameCmp will now return 0 if a null character is reached in one of the strings at the same location as a space in the other
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
97
diff
changeset
|
50 $(LD) $(LDFLAGS) -T scripts/linker.script -o $@ $^ |
100
d8f21e4a75e3
Added a simple program that is just an infinite loop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
99
diff
changeset
|
51 infLoop: $(infLoop_OBJS) |
d8f21e4a75e3
Added a simple program that is just an infinite loop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
99
diff
changeset
|
52 $(LD) $(LDFLAGS) -T scripts/linkerProg.script -o $@ $^ |
0 | 53 |
40
40af39d064fa
Refactor the arch code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
19
diff
changeset
|
54 arch/arch.a: $(ARCH_OBJS) |
40af39d064fa
Refactor the arch code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
19
diff
changeset
|
55 $(AR) rc $@ $^ |
40af39d064fa
Refactor the arch code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
19
diff
changeset
|
56 |
0 | 57 %.o: %.S |
85
e7b9148156c4
arch: hopefully the rest of the SVC related code
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
83
diff
changeset
|
58 $(CC) $(CFLAGS) -c -o $@ $< |
0 | 59 |
60 %.o: %.c | |
61 $(CC) $(CFLAGS) -include include/system.h -c -o $@ $< | |
62 | |
19
d24d69066fc0
added C++ build support
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
11
diff
changeset
|
63 %.o: %.cpp |
d24d69066fc0
added C++ build support
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
11
diff
changeset
|
64 $(CXX) $(CXXFLAGS) -include include/system.h -c -o $@ $< |
d24d69066fc0
added C++ build support
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
11
diff
changeset
|
65 |
0 | 66 # |
67 # IPL specific bits | |
68 # | |
69 | |
70 .PRECIOUS: ipl/loader.o ipl/loader_c.o ipl/loader_asm.o ipl/setmode.o \ | |
71 ipl/ipl_ccws.o ipl/ipl.o | |
72 | |
73 loader.bin: ipl/ipl.rto ipl/ipl_ccws.rto ipl/setmode.rto ipl/loader.rto | |
74 cat $^ > $@ | |
75 ( len=`stat -c %s "$@"`; dif=`expr $$len % 80`; if [ $$dif -ne 0 ]; then dif=`expr 80 - $$dif`; dd if=/dev/zero bs=1 count=$$dif 2> /dev/null >> "$@"; fi) | |
76 | |
77 ipl/loader_asm.o: ipl/loader_asm.S | |
78 $(AS) -m64 -o $@ $< | |
79 | |
11
ec991c3809db
make the ipl code generic
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
10
diff
changeset
|
80 ipl/loader_c.o: ipl/loader.c |
ec991c3809db
make the ipl code generic
Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
parents:
10
diff
changeset
|
81 $(CC) $(CFLAGS) -DBLOCK_SIZE=80 -c -o $@ $< |
0 | 82 |
83 ipl/ipl_ccws.S: ipl/setmode.rto ipl/loader.rto | |
84 bash scripts/gen_ccws.sh $@ | |
85 | |
86 ipl/loader.rto: ipl/loader.o | |
87 $(OBJCOPY) -O binary -j .text -j .data -j .rodata $< $@ | |
88 | |
89 ipl/loader.o: ipl/loader_c.o ipl/loader_asm.o | |
90 $(LD) -melf64_s390 -T ipl/linker.script -o $@ $^ | |
91 | |
92 ipl/%.rto: ipl/%.o | |
93 $(OBJCOPY) -O binary -j .text $< $@ | |
94 | |
95 ipl/%.o: ipl/%.S | |
96 $(AS) -m64 -o $@ $< | |
6
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
97 |
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
98 depend: |
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
99 makedepend -I include src/*.c |
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
100 |
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
101 # DO NOT DELETE |
8676cf44c307
Added functions pow, dup, and drop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
2
diff
changeset
|
102 |
97 | 103 src/dynamic.o: include/std.h include/die.h include/string.h include/stack.h |
74
36e6fc4a0487
Added the ability to create a new file
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
61
diff
changeset
|
104 src/fs.o: include/fs.h include/std.h include/die.h include/error.h |
97 | 105 src/fs.o: include/string.h include/tod.h |
61
5e1d4b26c2ef
Added the ability to write an arbitrary block of data to some file
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
51
diff
changeset
|
106 src/operations.o: include/operations.h include/std.h include/die.h |
97 | 107 src/operations.o: include/stack.h include/string.h include/math.h |
108 src/sarpn.o: include/std.h include/die.h include/string.h | |
109 src/sarpn.o: include/operations.h include/stack.h | |
99
2a0aa3efc228
The shell script will now theroretically load the program into memory, will not run it.
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
98
diff
changeset
|
110 src/shell.o: include/std.h include/die.h include/string.h include/stdio.h |
100
d8f21e4a75e3
Added a simple program that is just an infinite loop
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
99
diff
changeset
|
111 src/shell.o: include/error.h include/fs.h include/elf.h include/psw.h |
103
963bed9f5592
Attempted to set up the syscall handler
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
101
diff
changeset
|
112 src/shell.o: include/svc.h include/os/scall.h |
61
5e1d4b26c2ef
Added the ability to write an arbitrary block of data to some file
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
51
diff
changeset
|
113 src/stack.o: include/stack.h include/std.h include/die.h |
97 | 114 src/std.o: include/std.h include/die.h include/string.h |
115 src/stdio.o: include/stdio.h include/std.h include/die.h include/string.h | |
116 src/stdio.o: include/stdarg.h | |
74
36e6fc4a0487
Added the ability to create a new file
Jonathan Pevarnek <pevarnj@gmail.com>
parents:
61
diff
changeset
|
117 src/testFS.o: include/std.h include/die.h include/fs.h include/error.h |