-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 949 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
INCLUDE_PATH = $(HPGCC)/include
LIBS_PATH = $(HPGCC)/lib
HPAPINE = $(HPAPINEROOT)
export CUR_DIR = $(shell pwd)
export CC = arm-elf-gcc
export C_FLAGS = -mtune=arm920t -mcpu=arm920t \
-mlittle-endian -fomit-frame-pointer -msoft-float -Wall \
-Os -I$(INCLUDE_PATH) -L$(LIBS_PATH) -mthumb-interwork -mthumb
export LD = arm-elf-ld
export LD_FLAGS = -L$(LIBS_PATH) -T VCld.script $(LIBS_PATH)/crt0.o
export LIBS = -lhpg -lhplib -lgcc
export AR = arm-elf-ar
export RANLIB = arm-elf-ranlib
export ELF2HP = elf2hp
SRC = $(shell echo *.c)
OBJ = $(SRC:%.c=%.o)
EXE = $(SRC:%.c=%.exe)
HP = $(SRC:%.c=%.hp)
all: $(HP)
install: all
clean:
-rm -f *.o
-rm -f *.hp
-rm -f *.exe
%.o: %.c
$(CC) $(C_FLAGS) -c $<
%.exe: %.o
$(LD) $(LD_FLAGS) $< $(LIBS) -o $@
%.hp: %.exe
$(ELF2HP) $< $@
%_local: %.c
gcc -Wall -g -o $@ $< -DHPGCC -I $(HPAPINE)/include/ \
-DHPAPINE -L $(HPAPINE)/lib/ -lhpapine \
$(shell pkg-config --libs gdk-2.0 gthread-2.0)