Permalink
Browse files

Merge branch 'dev_freebsd'

  • Loading branch information...
alxm committed Aug 11, 2016
2 parents c35d64f + cee0340 commit 1f805ee0e8d941c975c0e1f18a5d14d8362fad9d
Showing with 18 additions and 9 deletions.
  1. +13 −5 bin/a2x_install
  2. +1 −1 make/a2x/rules
  3. +2 −2 make/platforms/linux
  4. +1 −1 make/project/rules
  5. +1 −0 src/a2x_pack_png.c
@@ -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))
@@ -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))
@@ -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)
@@ -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
@@ -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
@@ -19,6 +19,7 @@

#include "a2x_pack_png.v.h"

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

typedef struct AByteStream {

0 comments on commit 1f805ee

Please sign in to comment.