• Advertisement
  • entries
    732
  • comments
    1562
  • views
    493216

CSRPG2: Linux makefile

Sign in to follow this  

72 views

A chap called Patrick Horn emailed me this morning and sent me a Makefile for CSRPG2:

Makefile (in top-level CSRPG2 directory - recursive to src directory)
------------------------
SUBDIRS = src

all:
@for x in $(SUBDIRS); do cd $$x && $(MAKE) -$(MAKEFLAGS) all; done
@[ -e src/csrpg ] && echo 'Compile finished. Run src/csrpg from the current directory.'

clean:
@for x in $(SUBDIRS); do cd $$x && $(MAKE) -$(MAKEFLAGS) clean; done

.PHONY: clean all
--------------------------

src/Makefile
------------------------
# Compiler Options
OPTIMIZE = -O2
CFLAGS = -I/usr/include/SDL
LIBS = -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer

# Source files
SOURCES = $(wildcard *.cpp)
OBJS = $(SOURCES:.cpp=.o)

MAIN = csrpg

all: $(MAIN)

$(MAIN): $(OBJS)
g++ $(OBJS) -o$(MAIN) $(LIBS) $(OPTIMIZE)

.cpp.o:
g++ $< $(CFLAGS) -c -o $@ $(OPTIMIZE)

.PHONY: clean all

clean:
rm $(OBJS) $(MAIN)
-------------------------


So there you go! Now everything works great on Linux.
Sign in to follow this  


3 Comments


Recommended Comments

I came into your journal expecting hobo kittens. Where the fuck are the hobo kittens ravuya. Where are they. Give them to me.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement