Commits

Anonymous committed b964016 Draft

Added Linux x86 desktop makefile

  • Participants
  • Parent commits dc650f0

Comments (0)

Files changed (1)

+INCLUDES := 
+
+CC		:= g++
+
+CFLAGS  := -O2 -Wall $(INCLUDES) $(shell sdl-config --cflags)
+LDFLAGS := -O2 -Wall $(shell sdl-config --libs) -lSDL_gfx -lSDL_image
+
+
+LIBS=-lm `sdl-config --libs` -lSDL_image -lSDL_ttf -lSDL_mixer
+OBJS=sound.o collide.o ball.o game.o menu.o player.o randgen.o init.o main.o
+OUTPUT=battlepong.exe
+
+default: clean all
+
+PHONY: clean run default
+
+clean:
+	@echo Cleaning...
+	rm -f $(OUTPUT) $(OBJS)
+	rm -f *~
+	@echo Done.
+
+run: clean all
+	@echo Runing...
+	./$(OUTPUT)
+
+all: $(OBJS)
+	$(CC) $(CFLAGS) $(OBJS) -o $(OUTPUT) $(LIBS)
+
+main.o:	 main.cpp gamedefs.h randgen.h init.h menu.h game.h
+	$(CC) $(CFLAGS) -c main.cpp
+
+sound.o: sound.cpp sound.h
+	$(CC) $(CFLAGS) -c sound.cpp
+
+randgen.o: randgen.cpp randgen.h
+	$(CC) $(CFLAGS) -c randgen.cpp
+
+collide.o: collide.cpp collide.h
+	$(CC) $(CFLAGS) -c collide.cpp
+
+game.o: game.cpp game.h gamedefs.h init.h
+	$(CC) $(CFLAGS) -c game.cpp
+
+menu.o: menu.cpp menu.h gamedefs.h init.h
+	$(CC) $(CFLAGS) -c menu.cpp
+
+init.o: init.cpp init.h gamedefs.h randgen.h player.h ball.h
+	$(CC) $(CFLAGS) -c init.cpp
+
+player.o: player.cpp player.h gamedefs.h
+	$(CC) $(CFLAGS) -c player.cpp
+
+ball.o: ball.cpp ball.h gamedefs.h randgen.h collide.h player.h
+	$(CC) $(CFLAGS) -c ball.cpp