File: Makefile

package info (click to toggle)
libsdl-sge 020904-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 928 kB
  • ctags: 775
  • sloc: cpp: 8,049; makefile: 163; ansic: 44
file content (88 lines) | stat: -rw-r--r-- 2,352 bytes parent folder | download
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Makefile for the SGE library

include Makefile.conf

CFLAGS += $(SGE_CFLAGS) $(FT_CFLAGS)
LIBS =$(SGE_LIBS)

SGE_VER = 020904
API_VER = 0

ifeq ($(C_ONLY),y)
#  CFLAGS +=-D_SGE_C
endif


OBJECTS=sge_surface.o sge_primitives.o sge_tt_text.o sge_bm_text.o sge_misc.o sge_textpp.o sge_blib.o sge_rotation.o sge_collision.o sge_shape.o

all:	config $(OBJECTS) 
	ar rsc libSGE.a $(OBJECTS)

$(OBJECTS):	%.o:%.cpp %.h   #Each object depends on thier .cpp and .h file
	$(CXX) $(CFLAGS) -c $<

shared: all
	$(CXX) $(CFLAGS) -Wl,-soname,libSGE.so.$(API_VER) -fpic -fPIC -shared -o libSGE.so.$(API_VER).$(SGE_VER) $(OBJECTS) $(LIBS)

shared-strip:	shared
	@strip libSGE.so.$(API_VER).$(SGE_VER)

# Building a dll... I have no idea how to do this, but it should be something like below.
dll:	config $(OBJECTS)
	dlltool --output-def SGE.def $(OBJECTS)
	dllwrap --driver-name $(CXX) -o SGE.dll --def SGE.def --output-lib libSGE.a --dllname SGE.dll $(OBJECTS) $(LIBS)

dll-strip:	dll
	@strip SGE.dll

clean:
	@rm -f *.o *.so *.so.* *.a *.dll *.def

config:
	@echo "/* SGE Config header (generated automatically) */" >sge_config.h
	@echo "#define SGE_VER $(SGE_VER)" >>sge_config.h	
ifeq ($(NOTTF),y)
	@echo "#define _SGE_NOTTF" >>sge_config.h
endif
ifeq ($(USE_IMG),y)
	@echo "#define _SGE_HAVE_IMG" >>sge_config.h
endif
ifeq ($(NO_CLASSES),y)
	@echo "#define _SGE_NO_CLASSES" >>sge_config.h
endif
ifeq ($(C_ONLY),y)
	@echo "#define _SGE_C" >>sge_config.h
endif

ifneq ($(QUIET),y)
	@echo "== SGE r$(SGE_VER)"
ifeq ($(C_ONLY),y)
	@echo "== Warning: Using C references!"
endif
ifeq ($(NOTTF),y)
	@echo "== FreeType2 support disabled."
else
	@echo "== FreeType2 support enabled."
endif
ifeq ($(USE_IMG),y)
	@echo "== SDL_Image (SFont) support enabled."
else
	@echo "== SDL_Image (SFont) support disabled."
endif
ifeq ($(NO_CLASSES),y)
	@echo "== Warning: No C++ classes will be build!"
endif
	@echo ""	
endif

install:	shared
	@mkdir -p $(PREFIX)/include/SDL
	install -c -m 644 sge*.h $(PREFIX)/include/SDL
	@mkdir -p $(PREFIX)/lib
	install -c -m 644 libSGE.a $(PREFIX)/lib
	install -c libSGE.so.$(API_VER).$(SGE_VER) $(PREFIX)/lib/
	@cd $(PREFIX)/lib;\
	ln -s libSGE.so.$(API_VER).$(SGE_VER) libSGE.so.$(API_VER);\
	ln -s libSGE.so.$(API_VER) libSGE.so
	@echo "** Headerfiles installed in $(PREFIX)/include/SDL"
	@echo "** Library files installed in $(PREFIX)/lib"