Changeset 439


Ignore:
Timestamp:
Apr 4, 2018, 3:35:24 PM (6 years ago)
Author:
satin@…
Message:

Introduice new distributed Makefile architecture.
Remove deprecated sys/ directory

Location:
trunk
Files:
51 added
17 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/init/Makefile

    r427 r439  
    11#########################################################################
    2 # Makefile for the ALMOS-MKH "init" application on the TSAR architecture
     2# Makefile for the ALMOS-MKH "init" application
    33#########################################################################
    44
    5 CC = mipsel-unknown-elf-gcc
    6 AS = mipsel-unknown-elf-as
    7 LD = mipsel-unknown-elf-ld
    8 DU = mipsel-unknown-elf-objdump
    9 AR = mipsel-unknown-elf-ar
     5-include ../../params-soft.mk
     6ifeq ($(ARCH_NAME),)
     7$(error Please define in ARCH_NAME parameter in params-soft.mk!)
     8endif
    109
    11 LIBS = ../../libs
    12 
    13 HAL  = ../../hal
    14 
    15 KERNEL = ../../kernel
    16 
    17 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \
    18                  -fno-delete-null-pointer-checks -fomit-frame-pointer
    19 
    20 OBJS = init.o                    \
    21        $(LIBS)/build/stdlib.o    \
    22        $(LIBS)/build/stdio.o     \
    23        $(LIBS)/build/pthread.o   \
    24        $(LIBS)/build/malloc.o    \
    25        $(LIBS)/build/hal_user.o
     10OBJS = build/init.o
    2611
    2712INCLUDES = -I.                   \
    2813           -I../..               \
    29            -I$(LIBS)/            \
    30            -I$(KERNEL)/syscalls  \
    31            -I$(HAL)/generic
     14           -I$(LIBC_INCLUDE)/    \
     15           -I$(LIBPTHREAD_INCLUDE) \
    3216
    33 init.elf : $(OBJS) init.ld
    34         $(LD) -o $@ -T init.ld $(OBJS)
     17compile : dirs build/init.elf
     18build/init.elf : $(OBJS) init.ld
     19        $(LD) -o $@ -T init.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
    3520        $(DU) -D $@ > $@.txt
    3621
    37 init.o : init.c
     22build/init.o : init.c
    3823        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    3924        $(DU) -D $@ > $@.txt
    4025
    41 $(LIBS)/build/hal_user.o : $(HAL)/tsar_mips32/core/hal_user.c $(HAL)/generic/hal_user.h
    42         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    43         $(DU) -D $@ > $@.txt
    44 
    45 $(LIBS)/build/stdlib.o : $(LIBS)/stdlib.c $(LIBS)/stdlib.h
    46         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    47         $(DU) -D $@ > $@.txt
    48 
    49 $(LIBS)/build/stdio.o : $(LIBS)/stdio.c $(LIBS)/stdio.h
    50         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    51         $(DU) -D $@ > $@.txt
    52 
    53 $(LIBS)/build/pthread.o : $(LIBS)/pthread.c $(LIBS)/pthread.h
    54         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    55         $(DU) -D $@ > $@.txt
    56 
    57 $(LIBS)/build/malloc.o : $(LIBS)/malloc.c $(LIBS)/malloc.h
    58         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    59         $(DU) -D $@ > $@.txt
    60 
    61 
     26dirs:
     27        @mkdir -p build
    6228
    6329clean:
    64         rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt
     30        rm -rf build/*.o build/*.elf build/*.o.txt
     31
     32.PHONY: dirs clean
     33
  • trunk/user/ksh/Makefile

    r427 r439  
    11#########################################################################
    2 # Makefile for the ALMOS-MKH "ksh" application on the TSAR architecture
     2# Makefile for the ALMOS-MKH "ksh" application
    33#########################################################################
    44
    5 CC = mipsel-unknown-elf-gcc
    6 AS = mipsel-unknown-elf-as
    7 LD = mipsel-unknown-elf-ld
    8 DU = mipsel-unknown-elf-objdump
    9 AR = mipsel-unknown-elf-ar
     5-include ../../params-soft.mk
     6ifeq ($(ARCH_NAME),)
     7$(error Please define in ARCH_NAME parameter in params-soft.mk!)
     8endif
    109
    11 LIBS = ../../libs
     10OBJS = build/ksh.o
    1211
    13 HAL  = ../../hal
     12INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
    1413
    15 KERNEL = ../../kernel
    16 
    17 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \
    18                  -fno-delete-null-pointer-checks -fomit-frame-pointer
    19 
    20 OBJS = ksh.o                    \
    21        $(LIBS)/build/stdlib.o   \
    22        $(LIBS)/build/stdio.o    \
    23        $(LIBS)/build/string.o   \
    24        $(LIBS)/build/malloc.o   \
    25        $(LIBS)/build/pthread.o  \
    26        $(LIBS)/build/hal_user.o
    27        
    28 
    29 INCLUDES = -I. -I$(LIBS) -I$(KERNEL)/syscalls -I$(HAL)/generic
    30 
    31 ksh.elf : $(OBJS) ksh.ld
    32         $(LD) -o $@ -T ksh.ld $(OBJS)
     14compile: dirs build/ksh.elf
     15build/ksh.elf : $(OBJS) ksh.ld
     16        $(LD) -o $@ -T ksh.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
    3317        $(DU) -D $@ > $@.txt
    3418
    35 ksh.o : ksh.c
     19build/ksh.o : ksh.c
    3620        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    3721        $(DU) -D $@ > $@.txt
    3822
    39 $(LIBS)/build/hal_user.o : $(HAL)/tsar_mips32/core/hal_user.c $(HAL)/generic/hal_user.h
    40         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    41         $(DU) -D $@ > $@.txt
    42 
    43 $(LIBS)/build/stdlib.o : $(LIBS)/stdlib.c $(LIBS)/stdlib.h
    44         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    45         $(DU) -D $@ > $@.txt
    46 
    47 $(LIBS)/build/stdio.o : $(LIBS)/stdio.c $(LIBS)/stdio.h
    48         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    49         $(DU) -D $@ > $@.txt
    50 
    51 $(LIBS)/build/string.o : $(LIBS)/string.c $(LIBS)/string.h
    52         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    53         $(DU) -D $@ > $@.txt
    54 
    55 $(LIBS)/build/malloc.o : $(LIBS)/malloc.c $(LIBS)/malloc.h
    56         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    57         $(DU) -D $@ > $@.txt
    58 
    59 $(LIBS)/build/pthread.o : $(LIBS)/pthread.c $(LIBS)/pthread.h
    60         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    61         $(DU) -D $@ > $@.txt
     23dirs:
     24        @mkdir -p build/
    6225
    6326clean:
    64         rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt
     27        rm -rf build/*.o build/*.elf build/*.o.txt
     28
     29.PHONY: dirs clean
    6530
    6631
  • trunk/user/pgcd/Makefile

    r427 r439  
    11############################################################################
    2 # Makefile for the ALMOS-MKH "pgcd" application on the TSAR architecture
     2# Makefile for the ALMOS-MKH "pgcd" application
    33############################################################################
    44
    5 CC = mipsel-unknown-elf-gcc
    6 AS = mipsel-unknown-elf-as
    7 LD = mipsel-unknown-elf-ld
    8 DU = mipsel-unknown-elf-objdump
    9 AR = mipsel-unknown-elf-ar
     5-include ../../params-soft.mk
     6ifeq ($(ARCH_NAME),)
     7$(error Please define in ARCH_NAME parameter in params-soft.mk!)
     8endif
    109
    11 LIBS = ../../libs
     10OBJS = build/pgcd.o
    1211
    13 HAL  = ../../hal
     12INCLUDES = -I. -I$(LIBC_INCLUDE)
    1413
    15 KERNEL = ../../kernel
    16 
    17 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \
    18                  -fno-delete-null-pointer-checks -fomit-frame-pointer
    19 
    20 OBJS = pgcd.o                   \
    21        $(LIBS)/build/stdlib.o   \
    22        $(LIBS)/build/stdio.o    \
    23        $(LIBS)/build/hal_user.o
    24 
    25 INCLUDES = -I. -I$(LIBS) -I$(KERNEL)/syscalls -I$(HAL)/generic
    26 
    27 pgcd.elf : $(OBJS) pgcd.ld
    28         $(LD) -o $@ -T pgcd.ld $(OBJS)
     14compile: dirs build/pgcd.elf
     15build/pgcd.elf : $(OBJS) pgcd.ld
     16        $(LD) -o $@ -T pgcd.ld $(OBJS) -nostdlib -L$(LIBC) -lc
    2917        $(DU) -D $@ > $@.txt
    3018
    31 pgcd.o : pgcd.c
    32         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
     19build/pgcd.o : pgcd.c
     20        $(CC) $(INCLUDES) -L$(LIBC) $(CFLAGS) -c -o  $@ $<
    3321        $(DU) -D $@ > $@.txt
    3422
    35 $(LIBS)/build/hal_user.o : $(HAL)/tsar_mips32/core/hal_user.c $(HAL)/generic/hal_user.h
    36         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    37         $(DU) -D $@ > $@.txt
    38 
    39 $(LIBS)/build/stdlib.o : $(LIBS)/stdlib.c $(LIBS)/stdlib.h
    40         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    41         $(DU) -D $@ > $@.txt
    42 
    43 $(LIBS)/build/stdio.o : $(LIBS)/stdio.c $(LIBS)/stdio.h
    44         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    45         $(DU) -D $@ > $@.txt
     23dirs:
     24        @mkdir -p build/
    4625
    4726clean:
    48         rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt
     27        rm -rf build/*.o build/*.elf build/*.o.txt
     28
     29.PHONY: dirs clean
     30
     31
  • trunk/user/sort/Makefile

    r427 r439  
    11############################################################################
    2 # Makefile for the ALMOS-MKH "sort" application on the TSAR architecture
     2# Makefile for the ALMOS-MKH "sort" application
    33############################################################################
    44
    5 CC = mipsel-unknown-elf-gcc
    6 AS = mipsel-unknown-elf-as
    7 LD = mipsel-unknown-elf-ld
    8 DU = mipsel-unknown-elf-objdump
    9 AR = mipsel-unknown-elf-ar
     5-include ../../params-soft.mk
     6ifeq ($(ARCH_NAME),)
     7$(error Please define in ARCH_NAME parameter in params-soft.mk!)
     8endif
    109
    11 LIBS = ../../libs
     10OBJS = build/sort.o
    1211
    13 HAL  = ../../hal
     12INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
    1413
    15 KERNEL = ../../kernel
    16 
    17 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \
    18                  -fno-delete-null-pointer-checks -fomit-frame-pointer
    19 
    20 OBJS = sort.o                   \
    21        $(LIBS)/build/stdlib.o   \
    22        $(LIBS)/build/stdio.o    \
    23        $(LIBS)/build/pthread.o  \
    24        $(LIBS)/build/malloc.o   \
    25        $(LIBS)/build/hal_user.o
    26 
    27 INCLUDES = -I. -I$(LIBS) -I$(KERNEL)/syscalls -I$(HAL)/generic
    28 
    29 sort.elf : $(OBJS) sort.ld
    30         $(LD) -o $@ -T sort.ld $(OBJS)
     14compile: dirs build/sort.elf
     15build/sort.elf : $(OBJS) sort.ld
     16        $(LD) -o $@ -T sort.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
    3117        $(DU) -D $@ > $@.txt
    3218
    33 sort.o : sort.c
     19build/sort.o : sort.c
    3420        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    3521        $(DU) -D $@ > $@.txt
    3622
    37 $(LIBS)/build/hal_user.o : $(HAL)/tsar_mips32/core/hal_user.c $(HAL)/generic/hal_user.h
    38         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    39         $(DU) -D $@ > $@.txt
    40 
    41 $(LIBS)/build/stdlib.o : $(LIBS)/stdlib.c $(LIBS)/stdlib.h
    42         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    43         $(DU) -D $@ > $@.txt
    44 
    45 $(LIBS)/build/stdio.o : $(LIBS)/stdio.c $(LIBS)/stdio.h
    46         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    47         $(DU) -D $@ > $@.txt
    48 
    49 $(LIBS)/build/pthread.o : $(LIBS)/pthread.c $(LIBS)/pthread.h
    50         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    51         $(DU) -D $@ > $@.txt
    52 
    53 $(LIBS)/build/malloc.o : $(LIBS)/malloc.c $(LIBS)/malloc.h
    54         $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
    55         $(DU) -D $@ > $@.txt
     23dirs:
     24        @mkdir -p build/
    5625
    5726clean:
    58         rm -f *.o *.elf *.txt core $(LIBS)/build/*.o $(LIBS)/build/*.txt
     27        rm -rf build/*.o build/*.elf build/*.o.txt
     28
     29.PHONY: dirs clean
     30
Note: See TracChangeset for help on using the changeset viewer.