root/Whitix/branches/netchannel/make.inc

Revision 2084, 1.1 KB (checked in by mwhitworth, 2 years ago)

Merge all changes so far in network stack, too many to count.

Line 
1#Define DEPTH before including this file
2
3.PHONY: clean
4.IGNORE: clean
5
6CC = gcc
7CPP = gpp
8ASM = nasm
9RM  = rm -f
10SED = sed
11override CFLAGS += -fomit-frame-pointer -ffreestanding -fno-stack-protector -fno-builtin \
12        -nostdlib -m32 -Wall -Wextra -Werror -Os -I$(DEPTH)include -Wno-unused-parameter
13BE_VERBOSE = 0
14LD_R_FLAGS = -r -melf_i386
15
16MAKEFLAGS += --no-print-directory
17
18# Build the dependency list
19DEPS := $(MODULES:%.sys=.deps/%.d)
20DEPS += $(OBJS:%.o=.deps/%.d)
21
22%.o : %.c
23        @echo "  CC $*.c"
24        @$(CC) $(CFLAGS) -c $*.c -o $*.o
25        @$(CC) -MM $(CFLAGS) -c $*.c > .deps/$*.d
26
27%.sys : %.c
28        @echo "  CC $*.c (M)"
29        @$(CC) $(CFLAGS) -DMODULE -fno-common -c $*.c -o $*.sys
30        @$(CC) -MM $(CFLAGS) -DMODULE -c $*.c > .deps/$*.d
31        @$(SED) -i "s/$*.o/$*.sys/" .deps/$*.d
32
33#gas assembly files
34%.o : %.S
35        @$(CC) -I$(DEPTH)include -ffreestanding -fleading-underscore -fno-builtin -m32 -c $*.S -o $*.o
36        @echo "  AS $*.S"
37
38#for linker script
39%.lds: %.ld.S
40        @$(CC) -I$(DEPTH)include -Ui386 -nostdinc -C -P -E $*.ld.S -o $*.lds
41        @echo "  CPP $*.lds.S"
42
43ifneq ($(IGNORE_CLEAN), y)
44clean:
45        -rm -f *.o *.sys .deps/*.d
46endif
Note: See TracBrowser for help on using the browser.