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
|
--- server/Makefile
+++ server/Makefile
@@ -1,8 +1,9 @@
PREFIX = /usr/local
LIBDIR = $(PREFIX)/lib
-CFLAGS ?= -g -Wall -Werror -pipe `pkg-config glib-2.0 --cflags`
-LIBS ?= `pkg-config glib-2.0 --libs`
+CFLAGS ?= -g -Wall -Werror -pipe
+CPPFLAGS += -I. `pkg-config glib-2.0 --cflags` -DVERSION=\"$(shell cat ../VERSION)\"
+LDLIBS = `pkg-config glib-2.0 --libs`
ALLSRC = fb-server.c log.c tools.c game.c net.c
ALLOBJ = $(subst .c,.o,$(ALLSRC))
@@ -16,10 +17,6 @@
all: .depend fb-server
fb-server: $(ALLOBJ)
- $(CC) $(LIBS) -o $@ $^
-
-.c.o:
- $(CC) -I. $(CFLAGS) -DVERSION=\"$(shell cat ../VERSION)\" -c $<
clean:
rm -f fb-server *.o .depend
@@ -29,7 +26,7 @@
install fb-server $(DESTDIR)$(LIBDIR)/frozen-bubble
.depend:
- $(CPP) $(CFLAGS) -M $(ALLSRC) > .depend
+ $(CPP) $(CFLAGS) $(CPPFLAGS) -M $(ALLSRC) > .depend
ifeq (.depend,$(wildcard .depend))
include .depend
--- Makefile
+++ Makefile
@@ -15,7 +15,7 @@
@if ! perl -e 'use SDL'; then echo -e "\n *** I need perl-SDL installed"; false; fi
@if ! perl -e 'use SDL; ($$mj, $$mn, $$mc) = split /\./, $$SDL::VERSION; exit 0 if $$mj > 1 || $$mn >= 19; exit 1'; then echo -e "\n *** I need perl-SDL version 1.19.0 or upper"; false; fi
@for n in . $(DIRS); do \
- [ "$$n" = "." ] || $(MAKE) -C $$n ;\
+ [ "$$n" = "." ] || $(MAKE) -C $$n || exit $$? ;\
done
@if [ ! -d save_virgin ]; then mkdir save_virgin; cp c_stuff/lib/fb_stuff.pm save_virgin; fi
cp -f save_virgin/fb_stuff.pm c_stuff/lib/fb_stuff.pm
|