Skip to content

Commit

Permalink
Merge branch 'dev_freebsd'
Browse files Browse the repository at this point in the history
  • Loading branch information
alxm committed Aug 11, 2016
2 parents c35d64f + cee0340 commit 1f805ee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
18 changes: 13 additions & 5 deletions bin/a2x_install
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,26 @@
"""

import os
import sys

from utils.output import Output
from utils.shell import Shell
from utils.tool import Tool

class InstallTool(Tool):
def main(self):
make_command = self.get_arg('[clean]')
if sys.platform.startswith('linux'):
make = 'make'
elif sys.platform.startswith('freebsd'):
make = 'gmake'
else:
Output.error('Unknown platform {}'.format(sys.platform))

command = self.get_arg('[clean]')
userconfig = os.path.join(self.cfg_dir, 'sdk.config')
sdkconfig = os.path.join(self.make_dir, 'sdk.config')

if make_command == 'clean':
if command == 'clean':
if not os.path.exists(sdkconfig):
Output.note('Run {} first'.format(self.name))
Output.error('{} does not exist'.format(sdkconfig))
Expand All @@ -45,10 +53,10 @@ class InstallTool(Tool):

Output.info('Compiling a2x')

Shell.run('cd {} && make {}'
.format(os.path.join(self.make_dir, 'a2x'), make_command))
Shell.run('cd {} && {} {}'
.format(os.path.join(self.make_dir, 'a2x'), make, command))

if make_command == 'clean':
if command == 'clean':
Shell.run('rm {}'.format(sdkconfig))
else:
Output.note('Add {} to your $PATH'.format(self.bin_dir))
Expand Down
2 changes: 1 addition & 1 deletion make/a2x/rules
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ALL_DIRS = $(INC_DIR) $(LIB_DIR) $(OBJ_DIR) $(O_DIR) $(MEDIA_O_DIR)
all : $(ALL_DIRS) $(HEADER) $(LIBRARY)

$(ALL_DIRS) :
@ mkdir --parents $@
@ mkdir -p $@

$(HEADER) : $(H_FILES)
@ $(BIN_DIR)/a2x_header $(C_DIR) .p.h $(HEADER)
Expand Down
4 changes: 2 additions & 2 deletions make/platforms/linux
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ CFLAGS = -DA_PLATFORM_LINUXPC=1 \
-g

ifdef USE_LIB_SDL
LIBS := -lSDL_mixer -lSDL $(LIBS)
LIBS := $(shell sdl-config --libs) -lSDL_mixer $(LIBS)
CFLAGS += $(shell sdl-config --cflags) -DA_USE_LIB_SDL=1
else
LIBS := -lSDL2_mixer -lSDL2 $(LIBS)
LIBS := $(shell sdl2-config --libs) -lSDL2_mixer $(LIBS)
CFLAGS += $(shell sdl2-config --cflags) -DA_USE_LIB_SDL2=1
endif
2 changes: 1 addition & 1 deletion make/project/rules
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ $(TARGET_BINARY) : $(ALL_DIRS) $(C_GFX_FILES) $(C_SFX_FILES) $(C_GEN_HEADERS) $(
# make all the needed dirs
#
$(ALL_DIRS) :
@ mkdir --parents $@
@ mkdir -p $@

#
# pattern rules for building the universe
Expand Down
1 change: 1 addition & 0 deletions src/a2x_pack_png.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "a2x_pack_png.v.h"

#include <zlib.h>
#include <png.h>

typedef struct AByteStream {
Expand Down

0 comments on commit 1f805ee

Please sign in to comment.