From ac25438d54252d70de0002e4cca04ac258967c47 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 18 Dec 2019 17:35:46 -0600 Subject: Build: clean up build system, use one shared Makefile Allow everything to be built from the top level directory with just 'make', cleaned with 'make clean', and installed with 'make install'. Also support these in any particular subdirectory. Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as it runs. Kernel and early host tools (IPCCompiler, etc.) are built as object.host.o so that they don't conflict with other things built with the cross-compiler. --- Userland/Makefile | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'Userland') diff --git a/Userland/Makefile b/Userland/Makefile index b248af19bc..053b6426cc 100644 --- a/Userland/Makefile +++ b/Userland/Makefile @@ -1,28 +1,18 @@ -include ../Makefile.common - SRCS = $(wildcard *.cpp) OBJS = ${SRCS:.cpp=.o} APPS = ${SRCS:.cpp=} -DEFINES += -DUSERLAND +EXTRA_CLEAN = $(APPS) -.PHONY: all list clean +LDFLAGS = -lc -lhtml -lgui -ldraw -laudio -lipc -lthread -lcore -lpcidb -lmarkdown -lpthread -lprotocol -lipc all: $(OBJS) $(APPS) list: @echo $(APPS) -clean: - @echo "CLEAN" - @rm -f $(APPS) $(OBJS) *.d - -$(APPS) : % : %.o $(OBJS) - @echo "LD $@" - @$(LD) -o $@ $(LDFLAGS) $< -lc -lhtml -lgui -ldraw -laudio -lipc -lthread -lcore -lpcidb -lmarkdown -lpthread -lprotocol -lipc +$(APPS): %: %.o $(OBJS) + @echo "LINK $@" + $(QUIET) $(CXX) -o $@ $< $(LDFLAGS) -%.o: %.cpp - @echo "CXX $<" - @$(CXX) $(CXXFLAGS) -o $@ -c $< - --include $(OBJS:%.o=%.d) +include ../Makefile.common -- cgit v1.2.3