Rev 353 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
311 | giacomo | 1 | include $(BASE)/../shark.cfg |
2 | |||
2 | pj | 3 | CC = gcc |
4 | AS = gcc |
||
5 | LD = ld |
||
6 | AR = ar |
||
7 | INCL = $(BASE) |
||
8 | LIB_PATH = $(BASE)/lib/ |
||
588 | giacomo | 9 | LIB_DIR = $(BASE)/lib |
2 | pj | 10 | |
588 | giacomo | 11 | ifeq ($(findstring LINUX,$(ENV)) , LINUX) |
12 | CFG_OPT += -D__LINUX__ |
||
13 | endif |
||
14 | ifeq ($(findstring DJGPP,$(ENV)) , DJGPP) |
||
15 | CFG_OPT += -D__GNU__ |
||
16 | endif |
||
17 | |||
311 | giacomo | 18 | ifeq ($(TSC),TRUE) |
588 | giacomo | 19 | CFG_OPT += -D__TSC__ |
311 | giacomo | 20 | ifeq ($(APIC),TRUE) |
21 | CFG_OPT += -D__APIC__ |
||
22 | endif |
||
23 | endif |
||
24 | |||
332 | giacomo | 25 | ifeq ($(findstring 1000,$(TIMER_OPT)) , 1000) |
26 | CFG_OPT += -D__O1000__ |
||
27 | else |
||
28 | ifeq ($(findstring 2000,$(TIMER_OPT)) , 2000) |
||
29 | CFG_OPT += -D__O2000__ |
||
30 | else |
||
31 | ifeq ($(findstring 4000,$(TIMER_OPT)) , 4000) |
||
32 | CFG_OPT += -D__O4000__ |
||
33 | else |
||
336 | giacomo | 34 | CFG_OPT += -D__O8000__ |
332 | giacomo | 35 | endif |
36 | endif |
||
37 | endif |
||
38 | |||
353 | giacomo | 39 | ifeq ($(findstring NEW,$(TRACER)) , NEW) |
40 | CFG_OPT += -D__NEW_TRACER__ |
||
41 | endif |
||
42 | ifeq ($(findstring OLD,$(TRACER)) , OLD) |
||
43 | CFG_OPT += -D__OLD_TRACER__ |
||
44 | endif |
||
45 | |||
588 | giacomo | 46 | C_OPT = -Wall -O -fno-builtin -nostdinc $(CFG_OPT) -DMAIN=__kernel_init__ -I$(INCL) |
47 | ASM_OPT = -x assembler-with-cpp $(CFG_OPT) -I$(INCL) |
||
48 | LINK_OPT = -Bstatic -Ttext $(MEM_START) -s -nostartfiles -nostdlib -L$(LIB_PATH) |
||
2 | pj | 49 | |
588 | giacomo | 50 | MKDIR = mkdir |
145 | giacomo | 51 | CP = cp |
588 | giacomo | 52 | CAT = cat |
53 | RM = rm -f |
||
54 | RMDIR = rm -rf |
||
2 | pj | 55 | |
56 | # Common rules |
||
588 | giacomo | 57 | |
2 | pj | 58 | %.o : %.s |
59 | $(REDIR) $(CC) $(ASM_OPT) -c $< |
||
60 | %.o : %.c |
||
61 | $(REDIR) $(CC) $(C_OPT) -c $< |
||
588 | giacomo | 62 | %.s : %.c |
63 | $(REDIR) $(CC) $(C_OPT) -S $< |
||
64 |