2011-04-30 04:54:07 +04:00
|
|
|
CC = i686-pc-toaru-gcc
|
2012-01-19 06:12:04 +04:00
|
|
|
CPP = i686-pc-toaru-g++
|
2012-11-23 04:27:58 +04:00
|
|
|
STRIP = i686-pc-toaru-strip
|
2012-09-13 07:06:22 +04:00
|
|
|
CFLAGS = -std=c99 -U__STRICT_ANSI__ -O3 -m32 -Wa,--32
|
2012-02-20 18:39:00 +04:00
|
|
|
CPPFLAGS = -O3 -m32 -Wa,--32
|
2012-11-23 04:27:58 +04:00
|
|
|
EXTRAFLAGS = -s
|
2012-01-28 04:04:39 +04:00
|
|
|
EXECUTABLES = $(patsubst %.c,%.o,$(wildcard lib/*.c)) $(patsubst %.c,../hdd/bin/%,$(wildcard *.c)) $(patsubst %.cpp,../hdd/bin/%,$(wildcard *.cpp))
|
2012-01-26 03:07:42 +04:00
|
|
|
|
|
|
|
BEG = ../util/mk-beg
|
|
|
|
END = ../util/mk-end
|
|
|
|
INFO = ../util/mk-info
|
|
|
|
ERRORS = 2>>/tmp/.`whoami`-build-errors || ../util/mk-error
|
|
|
|
ERRORSS = >>/tmp/.`whoami`-build-errors || ../util/mk-error
|
|
|
|
|
|
|
|
BEGRM = ../util/mk-beg-rm
|
|
|
|
ENDRM = ../util/mk-end-rm
|
2011-04-30 04:54:07 +04:00
|
|
|
|
2012-05-17 19:50:25 +04:00
|
|
|
TOOLCHAIN= ../toolchain/local/i686-pc-toaru
|
|
|
|
|
|
|
|
FREETYPE_INC = -I ${TOOLCHAIN}/include/freetype2/
|
|
|
|
FREETYPE_LIB = ${TOOLCHAIN}/lib/libfreetype.a
|
2012-09-13 07:06:22 +04:00
|
|
|
LIBPNG = ${TOOLCHAIN}/lib/libpng.a
|
2012-05-17 19:50:25 +04:00
|
|
|
LIBM = ${TOOLCHAIN}/lib/libm.a
|
2012-09-13 07:06:22 +04:00
|
|
|
LIBZ = ${TOOLCHAIN}/lib/libz.a
|
2012-02-04 07:15:26 +04:00
|
|
|
|
2012-03-07 01:32:26 +04:00
|
|
|
TARGETDIR = ../hdd/bin/
|
2012-11-29 11:05:19 +04:00
|
|
|
ETARGETS = terminal login compositor view game drawlines glogin julia solver wallpaper panel glock clock-win draw test-gfx threadtest bim blur_test test-borders serial-console
|
2012-03-07 01:32:26 +04:00
|
|
|
FTARGETS = $(ETARGETS:%=$(TARGETDIR)%)
|
2011-04-30 04:54:07 +04:00
|
|
|
|
2012-10-09 09:33:46 +04:00
|
|
|
LOCAL_LIBS = $(patsubst %.c,%.o,$(wildcard lib/*.c))
|
|
|
|
|
2011-10-28 10:09:55 +04:00
|
|
|
.PHONY: all clean
|
2011-04-30 04:54:07 +04:00
|
|
|
|
2011-10-28 10:09:55 +04:00
|
|
|
all: ${EXECUTABLES}
|
2011-04-30 12:40:36 +04:00
|
|
|
|
2011-10-28 10:09:55 +04:00
|
|
|
clean:
|
2012-01-26 03:07:42 +04:00
|
|
|
@${BEGRM} "RM" "Cleaning userspace full-toolchain applications."
|
|
|
|
@-rm -f ${EXECUTABLES}
|
|
|
|
@${ENDRM} "RM" "Cleaned userspace full-toolchain applications."
|
2011-04-30 04:54:07 +04:00
|
|
|
|
2012-10-09 09:33:46 +04:00
|
|
|
${FTARGETS}: $(TARGETDIR)% : %.c ${LOCAL_LIBS}
|
2012-03-07 01:32:26 +04:00
|
|
|
@${BEG} "CC" "$@ $< [w/libs]"
|
2012-10-09 09:33:46 +04:00
|
|
|
@${CC} -flto ${CFLAGS} ${EXTRAFLAGS} ${FREETYPE_INC} -o $@ $< ${LOCAL_LIBS} ${LIBM} ${FREETYPE_LIB} ${LIBPNG} ${LIBZ} ${ERRORS}
|
2012-11-23 04:27:58 +04:00
|
|
|
@${STRIP} $@
|
2012-02-07 09:34:35 +04:00
|
|
|
@${END} "CC" "$< [w/libs]"
|
|
|
|
|
2012-03-07 01:32:26 +04:00
|
|
|
$(TARGETDIR)%: %.cpp
|
2012-01-26 03:07:42 +04:00
|
|
|
@${BEG} "CPP" "$<"
|
2012-02-09 08:49:32 +04:00
|
|
|
@${CPP} ${CPPFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
|
2012-01-26 03:07:42 +04:00
|
|
|
@${END} "CPP" "$<"
|
2012-01-19 06:12:04 +04:00
|
|
|
|
2012-05-01 22:40:04 +04:00
|
|
|
$(TARGETDIR)ld: ld.c lib/ldlib.o
|
2012-01-26 03:07:42 +04:00
|
|
|
@${BEG} "CC" "$< [-fPIC]"
|
2012-05-01 22:40:04 +04:00
|
|
|
@${CC} ${CFLAGS} ${EXTRAFLAGS} -fPIC -o $@ $< lib/ldlib.o ${ERRORS}
|
2012-01-26 03:07:42 +04:00
|
|
|
@${END} "CC" "$< [-fPIC]"
|
2012-01-19 06:12:04 +04:00
|
|
|
|
2012-03-07 01:32:26 +04:00
|
|
|
$(TARGETDIR)%: %.c
|
2012-01-26 03:07:42 +04:00
|
|
|
@${BEG} "CC" "$<"
|
2012-02-09 08:49:32 +04:00
|
|
|
@${CC} ${CFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
|
2012-01-26 03:07:42 +04:00
|
|
|
@${END} "CC" "$<"
|
|
|
|
|
2012-10-09 09:33:46 +04:00
|
|
|
$(TARGETDIR)esh: esh.c lib/list.o lib/kbd.o
|
2012-10-07 19:45:00 +04:00
|
|
|
@${BEG} "CC" "$<"
|
2012-10-09 09:33:46 +04:00
|
|
|
@${CC} ${CFLAGS} ${EXTRAFLAGS} -o $@ $< lib/list.o lib/kbd.o ${ERRORS}
|
2012-10-07 19:45:00 +04:00
|
|
|
@${END} "CC" "$<"
|
|
|
|
|
Context-based graphics library.
All graphics library commands now take a gfx_context_t pointer, which
points to a simple datastructure describing a rendering context (width,
height, depth, total size, front buffer, backbuffer; where backbuffer =
front buffer when not in double-buffering mode, thus we always render to
backbuffer except on a flip). This may have caused a minor speed
reduction, but I don't really care as it's far more important that we
support multiple graphics contexts.
TODO:
- Shared Memory Fonts library (there are a couple of apps that use these
so-called "shmem fonts" on their own; we need a dedicated library for
them)
- Break off "TTK" GUI toolkit into its own library. Since it's just a
callback-based button framework, this shouldn't be too hard right now.
Also, with the previous tick, I'll be able to put labels on controls
and start using text in more places.
2012-04-17 22:21:34 +04:00
|
|
|
lib/shmemfonts.o: lib/shmemfonts.c
|
|
|
|
@${BEG} "CC" "$< [lib]"
|
|
|
|
@${CC} ${CFLAGS} -c ${EXTRAFLAGS} ${FREETYPE_INC} -o $@ $< ${ERRORS}
|
|
|
|
@${END} "CC" "$< [lib]"
|
|
|
|
|
2012-01-28 04:04:39 +04:00
|
|
|
%.o: %.c
|
|
|
|
@${BEG} "CC" "$< [lib]"
|
2012-02-09 08:49:32 +04:00
|
|
|
@${CC} ${CFLAGS} -c ${EXTRAFLAGS} -o $@ $< ${ERRORS}
|
2012-01-28 04:04:39 +04:00
|
|
|
@${END} "CC" "$< [lib]"
|