1 |
# portable gui library |
2 |
|
3 |
all: riscos_release gtk_release |
4 |
debug: riscos_debug gtk_debug |
5 |
clean: |
6 |
-rm *.o |
7 |
|
8 |
|
9 |
SHARED_FLAGS = -std=c9x -Wall -W -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual \ |
10 |
-Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes \ |
11 |
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline |
12 |
# -mstubs |
13 |
RISCOS_FLAGS = $(SHARED_FLAGS) -Driscos |
14 |
RISCOS_TOOLS = /home/james/Tools |
15 |
RISCOS_RELEASE_CC = $(RISCOS_TOOLS)/riscos-gcc/cross/bin/gcc $(RISCOS_FLAGS) -O3 \ |
16 |
-I$(RISCOS_TOOLS)/oslib/ |
17 |
RISCOS_DEBUG_CC = $(RISCOS_TOOLS)/riscos-gcc/cross/bin/gcc $(RISCOS_FLAGS) -mpoke-function-name \ |
18 |
-DDEBUG -I$(RISCOS_TOOLS)/oslib/ |
19 |
RISCOS_LIBS = $(RISCOS_TOOLS)/oslib/lib/oslib.o |
20 |
|
21 |
GTK_FLAGS = $(SHARED_FLAGS) -Dgtk |
22 |
GTK_RELEASE_CC = gcc $(GTK_FLAGS) -O3 `gtk-config --cflags` |
23 |
GTK_DEBUG_CC = gcc $(GTK_FLAGS) -DDEBUG `gtk-config --cflags` |
24 |
GTK_LIBS = `gtk-config --libs` |
25 |
|
26 |
|
27 |
SHARED = messages textarea wstring |
28 |
LOCAL = main_PLAT window_PLAT dialog_PLAT textarea_PLAT menu_PLAT |
29 |
RISCOS = $(subst PLAT,riscos,$(LOCAL)) $(SHARED) ufont |
30 |
RISCOS_OBJS = $(addsuffix .ro.o,$(RISCOS)) |
31 |
GTK = $(subst PLAT,gtk,$(LOCAL)) $(SHARED) |
32 |
GTK_OBJS = $(addsuffix .gtk.o,$(GTK)) |
33 |
|
34 |
|
35 |
riscos_release: gui_riscos.o guitest.ro.o |
36 |
$(RISCOS_RELEASE_CC) -o !guitest/guitest,ff8 gui_riscos.o guitest.ro.o $(RISCOS_LIBS) |
37 |
riscos_debug: _gui_riscos.o _guitest.ro.o |
38 |
$(RISCOS_DEBUG_CC) -o !guitest/guitest,ff8 _gui_riscos.o _guitest.ro.o $(RISCOS_LIBS) |
39 |
|
40 |
gtk_release: gui_gtk.o guitest.gtk.o |
41 |
$(GTK_RELEASE_CC) -o guitest_gtk gui_gtk.o guitest.gtk.o $(GTK_LIBS) |
42 |
gtk_debug: _gui_gtk.o _guitest.gtk.o |
43 |
$(GTK_DEBUG_CC) -o guitest_gtk _gui_gtk.o _guitest.gtk.o $(GTK_LIBS) |
44 |
|
45 |
|
46 |
gui_riscos.o: $(RISCOS_OBJS) |
47 |
$(RISCOS_TOOLS)/riscos-gcc/cross/bin/libfile -c gui_riscos.o $(RISCOS_OBJS) |
48 |
_gui_riscos.o: $(addprefix _,$(RISCOS_OBJS)) |
49 |
$(RISCOS_TOOLS)/riscos-gcc/cross/bin/libfile -c _gui_riscos.o $(addprefix _,$(RISCOS_OBJS)) |
50 |
|
51 |
gui_gtk.o: $(GTK_OBJS) |
52 |
ld -r -o gui_gtk.o $(GTK_OBJS) |
53 |
_gui_gtk.o: $(addprefix _,$(GTK_OBJS)) |
54 |
ld -r -o _gui_gtk.o $(addprefix _,$(GTK_OBJS)) |
55 |
|
56 |
|
57 |
%.ro.o: %.c gui.h gui_riscos.h |
58 |
$(RISCOS_RELEASE_CC) -o $@ -c $< |
59 |
_%.ro.o: %.c gui.h gui_riscos.h |
60 |
$(RISCOS_DEBUG_CC) -o $@ -c $< |
61 |
|
62 |
%.gtk.o: %.c gui.h gui_gtk.h |
63 |
$(GTK_RELEASE_CC) -o $@ -c $< |
64 |
_%.gtk.o: %.c gui.h gui_gtk.h |
65 |
$(GTK_DEBUG_CC) -o $@ -c $< |