toaruos/userspace/Makefile

63 lines
2.1 KiB
Makefile
Raw Normal View History

2011-04-30 04:54:07 +04:00
CC = i686-pc-toaru-gcc
CPP = i686-pc-toaru-g++
CFLAGS = -std=c99 -O3 -m32 -Wa,--32 -Xlinker --eh-frame-hdr
CPPFLAGS = -O3 -m32 -Wa,--32
EXTRAFLAGS = -g
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
FREETYPE_INC = -I ../util/toaru-toolchain/i686-pc-toaru/include/freetype2/
FREETYPE_LIB = ../util/toaru-toolchain/i686-pc-toaru/lib/libfreetype.a
2012-02-07 09:34:35 +04:00
LIBM = ../util/toaru-toolchain/i686-pc-toaru/lib/libm.a
2012-03-07 01:32:26 +04:00
TARGETDIR = ../hdd/bin/
ETARGETS = terminal login compositor view game-win drawlines glogin julia-win solver donut wallpaper panel glock clock-win draw
2012-03-07 01:32:26 +04:00
FTARGETS = $(ETARGETS:%=$(TARGETDIR)%)
2011-04-30 04:54:07 +04:00
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-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
${FTARGETS}: $(TARGETDIR)% : %.c lib/graphics.o lib/list.o lib/window.o lib/sha2.o lib/decorations.o lib/pthread.o
2012-03-07 01:32:26 +04:00
@${BEG} "CC" "$@ $< [w/libs]"
@${CC} ${CFLAGS} ${EXTRAFLAGS} ${FREETYPE_INC} -o $@ $< lib/graphics.o lib/list.o lib/window.o lib/sha2.o lib/decorations.o lib/pthread.o ${LIBM} ${FREETYPE_LIB} ${ERRORS}
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" "$<"
@${CPP} ${CPPFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
2012-01-26 03:07:42 +04:00
@${END} "CPP" "$<"
2012-03-07 01:32:26 +04:00
$(TARGETDIR)ld: ld.c
2012-01-26 03:07:42 +04:00
@${BEG} "CC" "$< [-fPIC]"
@${CC} ${CFLAGS} ${EXTRAFLAGS} -fPIC -o $@ $< ${ERRORS}
2012-01-26 03:07:42 +04:00
@${END} "CC" "$< [-fPIC]"
2012-03-07 01:32:26 +04:00
$(TARGETDIR)%: %.c
2012-01-26 03:07:42 +04:00
@${BEG} "CC" "$<"
@${CC} ${CFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
2012-01-26 03:07:42 +04:00
@${END} "CC" "$<"
2012-03-15 00:04:12 +04:00
lib/decorations.o: lib/decorations.c
@${BEG} "CC" "$< [lib]"
@${CC} ${CFLAGS} -c ${EXTRAFLAGS} ${FREETYPE_INC} -o $@ $< ${ERRORS}
@${END} "CC" "$< [lib]"
%.o: %.c
@${BEG} "CC" "$< [lib]"
@${CC} ${CFLAGS} -c ${EXTRAFLAGS} -o $@ $< ${ERRORS}
@${END} "CC" "$< [lib]"