File: make-tips

package info (click to toggle)
acr 2.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 712 kB
  • sloc: sh: 4,738; makefile: 41
file content (40 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (5)
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
Makefiles suggestions
=====================

Always get the environment variables from ACR:

CC=@CC@
PREFIX=@PREFIX@
VPATH=@VPATH@
INSTALL_PROGRAM=@INSTALL_PROGRAM@

Start writing the makefile from the template created with 'acr -m' may be
a good idea.



Conditionals:
=============

For GNU make:

ifeq ($(HAVE_SDL_MIXER),1)
LDFLAGS+=-lSDL_mixer
endif

For BSD make

.if ${HAVE_SDL_MIXER} == "1"
LDFLAGS+=-lSDL_mixer
.endif


This is so tricky and system dependent...you can use ACR to fix this:

IF HAVE_SDL_MIXER LDFLAGS += -lSDL_mixer ;

But remember, this LDFLAGS will be world-wide, and may be interesting to
use different LDFLAGS for each program or directory src:

= GAME_LDFLAGS ;
IF HAVE_SDL_MIXER GAME_LDFLAGS += -lSDL_mixer ;