toaruos/userspace/Makefile
Kevin Lange 07955c83c6 Fix dozens of build warnings and other oddities.
* Finally bring syscall.h up to speed and include all syscalls in the
  syscall module of the C library.
* Remove the third-party obfuscated C demos (we have nyancat, good
  enough)
* Fix userspace apps to build without complaining about undeclared
  strtok_r by disable __STRICT_ANSI__
* Fix .eh_frame by including the proper stuff with libgcc.
2012-09-04 20:27:49 -07:00

65 lines
2.1 KiB
Makefile

CC = i686-pc-toaru-gcc
CPP = i686-pc-toaru-g++
CFLAGS = -std=c99 -U__STRICT_ANSI__ -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))
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
TOOLCHAIN= ../toolchain/local/i686-pc-toaru
FREETYPE_INC = -I ${TOOLCHAIN}/include/freetype2/
FREETYPE_LIB = ${TOOLCHAIN}/lib/libfreetype.a
LIBM = ${TOOLCHAIN}/lib/libm.a
TARGETDIR = ../hdd/bin/
ETARGETS = terminal login compositor view game-win drawlines glogin julia-win solver wallpaper panel glock clock-win draw test-gfx threadtest
FTARGETS = $(ETARGETS:%=$(TARGETDIR)%)
.PHONY: all clean
all: ${EXECUTABLES}
clean:
@${BEGRM} "RM" "Cleaning userspace full-toolchain applications."
@-rm -f ${EXECUTABLES}
@${ENDRM} "RM" "Cleaned userspace full-toolchain applications."
${FTARGETS}: $(TARGETDIR)% : %.c lib/graphics.o lib/list.o lib/window.o lib/sha2.o lib/decorations.o lib/pthread.o lib/shmemfonts.o
@${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 lib/shmemfonts.o ${LIBM} ${FREETYPE_LIB} ${ERRORS}
@${END} "CC" "$< [w/libs]"
$(TARGETDIR)%: %.cpp
@${BEG} "CPP" "$<"
@${CPP} ${CPPFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
@${END} "CPP" "$<"
$(TARGETDIR)ld: ld.c lib/ldlib.o
@${BEG} "CC" "$< [-fPIC]"
@${CC} ${CFLAGS} ${EXTRAFLAGS} -fPIC -o $@ $< lib/ldlib.o ${ERRORS}
@${END} "CC" "$< [-fPIC]"
$(TARGETDIR)%: %.c
@${BEG} "CC" "$<"
@${CC} ${CFLAGS} ${EXTRAFLAGS} -o $@ $< ${ERRORS}
@${END} "CC" "$<"
lib/shmemfonts.o: lib/shmemfonts.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]"