Skip to content

Commit

Permalink
Makefiles and static libs for building static binary
Browse files Browse the repository at this point in the history
  • Loading branch information
ec429 committed Jul 16, 2014
1 parent f890614 commit 25b1df6
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,7 @@ intel_targets.o: ui.h globals.h events.h bits.h date.h render.h
%.o: %.c %.h types.h dclass.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) -o $@ -c $<

static: all
mkdir static
cp -r art dat lib map save stats *.o static/
make -C static -f lib/Makefile -B harris
Binary file added lib/LMReg.ttf
Binary file not shown.
33 changes: 33 additions & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Makefile for Harris static binary

# Installation directories
DESTDIR ?=
PREFIX ?= /usr/local
BINIDIR := $(DESTDIR)$(PREFIX)/games
DATIDIR := $(DESTDIR)$(PREFIX)/share/games/harris
# User directories (relative to $HOME)
USAVDIR := .local/share/harris

LDFLAGS := -Llib/ -Wl,-rpath -Wl,lib

LIBS := -latg -lm
INTEL_OBJS := intel_bombers.o intel_fighters.o intel_targets.o
SCREEN_OBJS := main_menu.o setup_game.o setup_difficulty.o load_game.o save_game.o control.o run_raid.o raid_results.o post_raid.o $(INTEL_OBJS)
OBJS := weather.o bits.o rand.o geom.o widgets.o date.o history.o routing.o saving.o render.o events.o ui.o load_data.o dclass.o $(SCREEN_OBJS)
INCLUDES := $(OBJS:.o=.h) types.h globals.h version.h
SAVES := save/qstart.sav save/civ.sav save/abd.sav save/ruhr.sav

SDL := `sdl-config --libs` -lSDL_ttf -lSDL_gfx -lSDL_image
SDLFLAGS := `sdl-config --cflags`

harris:
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDLFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) harris.o -o $@ $(SDL)

install:
install -d $(BINIDIR) $(DATIDIR)
install harris $(BINIDIR)/
./install.py -d $(DATIDIR)

uninstall:
rm $(BINIDIR)/harris
rm -r $(DATIDIR)
Binary file added lib/libSDL-1.2.so.0
Binary file not shown.
Binary file added lib/libSDL_gfx.so.13
Binary file not shown.
Binary file added lib/libSDL_image-1.2.so.0
Binary file not shown.
Binary file added lib/libSDL_ttf-2.0.so.0
Binary file not shown.
Binary file added lib/libatg.so.1
Binary file not shown.
Binary file added lib/libdirect-1.2.so.9
Binary file not shown.
Binary file added lib/libdirectfb-1.2.so.9
Binary file not shown.
Binary file added lib/libfreetype.so.6
Binary file not shown.
Binary file added lib/libfusion-1.2.so.9
Binary file not shown.
Binary file added lib/libjbig.so.0
Binary file not shown.
Binary file added lib/libjpeg.so.8
Binary file not shown.
Binary file added lib/libpng12.so.0
Binary file not shown.
Binary file added lib/libtiff.so.4
Binary file not shown.
Binary file added lib/libwebp.so.2
Binary file not shown.
Binary file added lib/libz.so.1
Binary file not shown.

0 comments on commit 25b1df6

Please sign in to comment.