Source: moon-lander
Followup-For: Bug #555753

Dear Maintainer,

This package failed to build with gold/ld because it was missing a link
to libm. The attached Makefile links -lm and fixes the build.

Cheers,
Paul Merrill
# Makefile for test program for game_libs - lunar lander
CFLAGS+=-Wall `sdl-config --cflags` 
CC=gcc

LIBS=SDL_image `sdl-config --libs` -lm

C_FILES=moon_lander.c game_lib.c DT_drawtext.c
OBJ_FILES=moon_lander.o game_lib.o DT_drawtext.o 
OUT_FILE=moon-lander

all: game_lib

game_lib: $(OBJ_FILES)
	$(CC) $(CFLAGS) -o $(OUT_FILE) $(OBJ_FILES) -l$(LIBS) -lSDL_mixer

moon_lander.o: moon_lander.c
	$(CC) $(CFLAGS) -c -o $@ $^

game_lib.o: game_lib.c
	$(CC) $(CFLAGS) -c -o $@ $^

DT_drawtext.o: DT_drawtext.c
	$(CC) $(CFLAGS) -c -o $@ $^

clean: 
	rm -f $(OUT_FILE) $(OBJ_FILES)

install: 
	./install.sh


Reply via email to