Skip to content

Commit

Permalink
Merge pull request #36 from SanderMertens/bake_2_3
Browse files Browse the repository at this point in the history
Bake 2 3
  • Loading branch information
SanderMertens authored Feb 18, 2019
2 parents 595005b + 202c772 commit 5063ce8
Show file tree
Hide file tree
Showing 130 changed files with 6,632 additions and 2,911 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ bin
.DS_Store
*.so
*.dylib
bake
*.exe
*.lib
*.dll
bake
*.obj
*.exp
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
language: c

matrix:
include:
- os: linux
sudo: required
dist: trusty
compiler: gcc
- os: linux
sudo: required
dist: trusty
compiler: clang
- os: linux
sudo: required
dist: xenial
compiler: gcc
- os: linux
sudo: required
dist: xenial
compiler: clang
- os: osx
sudo: required
compiler: gcc
- os: osx
sudo: required
compiler: clang

install:
- make -C build-$(uname)
- ./bake setup

script:
- bake examples
- bake examples --cfg release
- bake list
- bake clone SanderMertens/example
- bake run example
- bake run example --cfg release
- bake new foo
- bake run foo
- bake run foo --cfg release
- bake new my_template --template
- bake new my_tmpl_app -t my_template
- bake run my_tmpl_app


488 changes: 363 additions & 125 deletions README.md

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 1.0.{build}
image: Visual Studio 2017
build_script:
- cmd: >-
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
cd build-Windows\
nmake
cd ..\
init:
-

test_script:
- cmd: bake.exe setup
- cmd: bake build examples
- cmd: bake build examples --cfg release
- cmd: bake list
- cmd: bake clone SanderMertens/example
- cmd: bake run example
- cmd: bake run example --cfg release
- cmd: bake new foo
- cmd: bake run foo
- cmd: bake run foo --cfg release
- cmd: bake new my_template --template
- cmd: bake new my_tmpl_app -t my_template
- cmd: bake run my_tmpl_app

22 changes: 13 additions & 9 deletions build-Darwin/bake.make
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ OBJECTS := \
$(OBJDIR)/rule.o \
$(OBJDIR)/run.o \
$(OBJDIR)/setup.o \
$(OBJDIR)/dl.o \
$(OBJDIR)/env.o \
$(OBJDIR)/expr.o \
$(OBJDIR)/file.o \
Expand All @@ -109,11 +108,13 @@ OBJECTS := \
$(OBJDIR)/os.o \
$(OBJDIR)/parson.o \
$(OBJDIR)/path.o \
$(OBJDIR)/dl.o \
$(OBJDIR)/fs1.o \
$(OBJDIR)/proc.o \
$(OBJDIR)/thread.o \
$(OBJDIR)/rb.o \
$(OBJDIR)/strbuf.o \
$(OBJDIR)/string.o \
$(OBJDIR)/thread.o \
$(OBJDIR)/time.o \
$(OBJDIR)/util.o \
$(OBJDIR)/version.o \
Expand Down Expand Up @@ -217,9 +218,6 @@ $(OBJDIR)/run.o: ../src/run.c
$(OBJDIR)/setup.o: ../src/setup.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/dl.o: ../util/src/dl.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/env.o: ../util/src/env.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
Expand Down Expand Up @@ -259,7 +257,16 @@ $(OBJDIR)/parson.o: ../util/src/parson.c
$(OBJDIR)/path.o: ../util/src/path.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/proc.o: ../util/src/proc.c
$(OBJDIR)/dl.o: ../util/src/posix/dl.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/fs1.o: ../util/src/posix/fs.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/proc.o: ../util/src/posix/proc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/thread.o: ../util/src/posix/thread.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rb.o: ../util/src/rb.c
Expand All @@ -271,9 +278,6 @@ $(OBJDIR)/strbuf.o: ../util/src/strbuf.c
$(OBJDIR)/string.o: ../util/src/string.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/thread.o: ../util/src/thread.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/time.o: ../util/src/time.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
Expand Down
22 changes: 13 additions & 9 deletions build-Linux/bake.make
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ OBJECTS := \
$(OBJDIR)/rule.o \
$(OBJDIR)/run.o \
$(OBJDIR)/setup.o \
$(OBJDIR)/dl.o \
$(OBJDIR)/env.o \
$(OBJDIR)/expr.o \
$(OBJDIR)/file.o \
Expand All @@ -93,11 +92,13 @@ OBJECTS := \
$(OBJDIR)/os.o \
$(OBJDIR)/parson.o \
$(OBJDIR)/path.o \
$(OBJDIR)/dl.o \
$(OBJDIR)/fs1.o \
$(OBJDIR)/proc.o \
$(OBJDIR)/thread.o \
$(OBJDIR)/rb.o \
$(OBJDIR)/strbuf.o \
$(OBJDIR)/string.o \
$(OBJDIR)/thread.o \
$(OBJDIR)/time.o \
$(OBJDIR)/util.o \
$(OBJDIR)/version.o \
Expand Down Expand Up @@ -201,9 +202,6 @@ $(OBJDIR)/run.o: ../src/run.c
$(OBJDIR)/setup.o: ../src/setup.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/dl.o: ../util/src/dl.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/env.o: ../util/src/env.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
Expand Down Expand Up @@ -243,7 +241,16 @@ $(OBJDIR)/parson.o: ../util/src/parson.c
$(OBJDIR)/path.o: ../util/src/path.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/proc.o: ../util/src/proc.c
$(OBJDIR)/dl.o: ../util/src/posix/dl.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/fs1.o: ../util/src/posix/fs.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/proc.o: ../util/src/posix/proc.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/thread.o: ../util/src/posix/thread.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/rb.o: ../util/src/rb.c
Expand All @@ -255,9 +262,6 @@ $(OBJDIR)/strbuf.o: ../util/src/strbuf.c
$(OBJDIR)/string.o: ../util/src/string.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/thread.o: ../util/src/thread.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
$(OBJDIR)/time.o: ../util/src/time.c
@echo $(notdir $<)
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) -o "$@" -MF "$(@:%.o=%.d)" -c "$<"
Expand Down
46 changes: 46 additions & 0 deletions build-Windows/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

!IFNDEF config
config = debug
!ENDIF

!IFNDEF verbose
SILENT = @
!ENDIF

!IF "$(config)" == "debug"
bake_config = debug
!ENDIF

!IF "$(config)" == "release"
bake_config = release
!ENDIF

PROJECTS = bake

.PHONY: all

all: $(PROJECTS)

bake:
!IF "$(bake_config)" != ""
@ECHO "==== Building bake ($(bake_config)) ===="
$(MAKE) /NOLOGO /F bake.mak config=$(bake_config) all
!ENDIF

clean:
$(MAKE) /F bake.mak clean

help:
@ECHO "Usage: nmake [config=name] [target]"
@ECHO ""
@ECHO "CONFIGURATIONS:"
@ECHO " debug"
@ECHO " release"
@ECHO ""
@ECHO "TARGETS:"
@ECHO " all (default)"
@ECHO " clean"
@ECHO " bake"
@ECHO ""
@ECHO "For more information, see https://github.com/premake/premake-core/wiki"

128 changes: 128 additions & 0 deletions build-Windows/bake.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# GNU Make project makefile autogenerated by Premake

LINK = link.exe

!IFNDEF config
config = debug
!ENDIF

!IFNDEF verbose
SILENT = @
!ENDIF

.PHONY: clean prebuild prelink

!IF "$(config)" == "debug"
TARGETDIR = ..
TARGET = $(TARGETDIR)\bake.exe
OBJDIR = ..\.bake_cache\debug
DEFINES = -DBAKE_IMPL -DUT_IMPL -DDEBUG $(DEFINES)
INCLUDES = /I ..\
FORCE_INCLUDE =
ALL_CPPFLAGS = /nologo $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(ALL_CPPFLAGS)
ALL_CFLAGS = /nologo $(CFLAGS) $(ALL_CPPFLAGS) $(ALL_CFLAGS)
ALL_RESFLAGS = /nologo $(RESFLAGS) $(DEFINES) $(INCLUDES) $(ALL_RESFLAGS)
LIBS = Ws2_32.lib Shlwapi.lib Kernel32.lib Dbghelp.lib Shell32.lib
ALL_LDFLAGS = $(LDFLAGS) $(ALL_LDFLAGS)
LINKCMD = $(LINK) /NOLOGO /OUT:"$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)

all: prebuild prelink $(TARGET)
@:

!ENDIF

!IF "$(config)" == "release"
TARGETDIR = ..
TARGET = $(TARGETDIR)\bake.exe
OBJDIR = ..\.bake_cache\release
DEFINES = -DBAKE_IMPL -DUT_IMPL $(DEFINES)
INCLUDES = /I ..\
FORCE_INCLUDE =
ALL_CPPFLAGS = $(CPPFLAGS) $(DEFINES) $(INCLUDES) $(ALL_CPPFLAGS)
ALL_CFLAGS = $(CFLAGS) $(ALL_CPPFLAGS) $(ALL_CFLAGS)
ALL_RESFLAGS = $(RESFLAGS) $(DEFINES) $(INCLUDES) $(ALL_RESFLAGS)
LIBS = Ws2_32.lib Shlwapi.lib Kernel32.lib Dbghelp.lib Shell32.lib
ALL_LDFLAGS = $(LDFLAGS) $(ALL_LDFLAGS)
LINKCMD = $(LINK) /OUT:"$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)

all: prebuild prelink $(TARGET) $(OBJDIR)
@:

!ENDIF

BAKE_SOURCE= ..\src\attribute.c \
..\src\build.c \
..\src\config.c \
..\src\crawler.c \
..\src\driver.c \
..\src\filelist.c \
..\src\git.c \
..\src\install.c \
..\src\json_utils.c \
..\src\main.c \
..\src\project.c \
..\src\rule.c \
..\src\run.c \
..\src\setup.c \

UTIL_SOURCE= ..\util\src\win\dl.c \
..\util\src\win\fs.c \
..\util\src\win\vs.c \
..\util\src\win\thread.c \
..\util\src\win\proc.c \
..\util\src\win\err.c \
..\util\src\env.c \
..\util\src\expr.c \
..\util\src\file.c \
..\util\src\fs.c \
..\util\src\iter.c \
..\util\src\jsw_rbtree.c \
..\util\src\ll.c \
..\util\src\load.c \
..\util\src\log.c \
..\util\src\memory.c \
..\util\src\os.c \
..\util\src\parson.c \
..\util\src\path.c \
..\util\src\rb.c \
..\util\src\strbuf.c \
..\util\src\string.c \
..\util\src\time.c \
..\util\src\util.c \
..\util\src\version.c

CPP_SOURCE=$(BAKE_SOURCE) $(UTIL_SOURCE)

OBJECTS=$(CPP_SOURCE:.c=.obj)

$(TARGET): $(GCH) $(OBJECTS) $(TARGETDIR)
@echo Linking bake
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)


$(TARGETDIR):
@echo Creating $(TARGETDIR)
$(SILENT) mkdir $(TARGETDIR)

$(OBJDIR):
@echo Creating $(OBJDIR)
$(SILENT) mkdir $(OBJDIR)

clean:
@echo Cleaning bake
$(SILENT) @if EXIST $(TARGET) del /Q $(TARGET)
$(SILENT) @if EXIST $(OBJDIR) del /Q $(OBJDIR)
$(SILENT) @if EXIST ..\src\*.obj del /Q ..\src\*.obj
$(SILENT) @if EXIST ..\util\src\*.obj del /Q ..\util\src\*.obj
$(SILENT) @if EXIST ..\util\src\win\*.obj del /Q ..\util\src\win\*.obj

prebuild:
$(PREBUILDCMDS)

prelink:
$(PRELINKCMDS)

.c.obj:
$(SILENT) $(CC) $(ALL_CFLAGS) $(FORCE_INCLUDE) /c $*.c /Fo$@

1 change: 1 addition & 0 deletions drivers/lang/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ static | bool | Create static library (packages only, default=false)
c-standard | string | Specify C standard (default=c99)
cpp-standard | string | Specify C++ standard (default=c++0x)
export-symbols | bool | Export all library symbols (default=false)
precompile-header | bool | Precompile main project header (default=true)

## Example

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5063ce8

Please sign in to comment.