Skip to content

Commit

Permalink
Add icon to built sassc executable
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Jul 15, 2015
1 parent 7394b81 commit 101a218
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bin/*
*.o
*.gem
*.res
.sass-cache

a.out
Expand Down
25 changes: 17 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,28 @@ OBJECTS = $(SOURCES:.c=.o)
TARGET = bin/sassc
SPEC_PATH = $(SASS_SPEC_PATH)

RESOURCES_REF =
RESOURCES_FILES =
ifeq (MinGW,$(UNAME))
RESOURCES_REF = resources
RESOURCES_FILES = libsass.res
TARGET = bin/sassc.exe
endif
ifeq (Windows,$(UNAME))
RESOURCES_REF = resources
RESOURCES_FILES = libsass.res
TARGET = bin/sassc.exe
endif

all: libsass $(TARGET)

$(TARGET): build-$(BUILD)

build-static: $(OBJECTS) $(LIB_STATIC)
$(CC) $(LDFLAGS) -o $(TARGET) $^ $(LDLIBS)

build-shared: $(OBJECTS) $(LIB_SHARED)
build-static: $(OBJECTS) $(LIB_STATIC) $(RESOURCES_REF)
$(CC) $(LDFLAGS) -o $(TARGET) $^ $(LDLIBS) $(RESOURCES_FILES)

build-shared: $(OBJECTS) $(LIB_SHARED) $(RESOURCES_REF)
$(MKDIR) bin/include
$(CP) $(LIB_SHARED) bin/
$(CP) $(SASS_LIBSASS_PATH)/sass.h bin/include
Expand All @@ -174,7 +181,7 @@ build-shared: $(OBJECTS) $(LIB_SHARED)
$(CP) $(SASS_LIBSASS_PATH)/sass_version.h bin/include
$(CP) $(SASS_LIBSASS_PATH)/sass_context.h bin/include
$(CP) $(SASS_LIBSASS_PATH)/sass_functions.h bin/include
$(CC) $(LDFLAGS) -o $(TARGET) $^ $(LDLIBS)
$(CC) $(LDFLAGS) -o $(TARGET) $^ $(LDLIBS) $(RESOURCES_FILES)

$(LIB_STATIC): libsass-static
$(LIB_SHARED): libsass-shared
Expand All @@ -201,6 +208,9 @@ endif
test: all
$(MAKE) -C $(SASS_LIBSASS_PATH) version

resources:
$(WINDRES) res/libsass.rc -O coff libsass.res

specs: all
ifdef SASS_LIBSASS_PATH
$(MAKE) -C $(SASS_LIBSASS_PATH) test_build
Expand All @@ -214,8 +224,7 @@ ifdef SASS_LIBSASS_PATH
$(MAKE) -C $(SASS_LIBSASS_PATH) clean
endif

.PHONY: all libsass \
clean test specs \
build-static build-shared \
libsass-static libsass-shared
.PHONY: resources test specs clean \
all build-static build-shared \
libsass libsass-static libsass-shared
.DELETE_ON_ERROR:
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
endif

bin_PROGRAMS = sassc
sassc_SOURCES = sassc.c
sassc_SOURCES = sassc.c res/libsass.rc
sassc_CFLAGS = $(AM_CFLAGS) $(LIBSASS_CFLAGS)
sassc_CXXFLAGS = $(AM_CXXFLAGS) $(LIBSASS_CFLAGS)
sassc_LDFLAGS= $(AM_LDFLAGS) $(LIBSASS_LIBS) $(LDLIBS)
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ if test "x$enable_cov" = "xyes"; then
AC_SUBST(GCOV)
fi

AC_CHECK_PROG(WINDRES, windres, windres)

AM_CONDITIONAL(ENABLE_COVERAGE, test "x$enable_cov" = "xyes")

AS_CASE([$host], [*-*-mingw32], [is_mingw32=yes], [is_mingw32=no])
Expand Down
Binary file added res/libsass.ico
Binary file not shown.
1 change: 1 addition & 0 deletions res/libsass.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
icon ICON "libsass.ico"

0 comments on commit 101a218

Please sign in to comment.