source: mainline/uspace/lib/posix/Makefile@ 241f1985

Last change on this file since 241f1985 was 2bb6d04, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

Curb the proliferation of libdraw headers

libdraw provides a lot of ambiguously named headers, which makes it
confusing. This change merges the subdirectories into single headers,
and moves all headers into draw subdirectory, so that it's obvious
at a glance what library the header belongs to.

Compare:

#include <path.h>
#include <source.h>
#include <font/bitmap_backend.h>
#include <font/pcf.h>

vs.

#include <draw/path.h>
#include <draw/source.h>
#include <draw/font.h>

  • Property mode set to 100644
File size: 4.9 KB
RevLine 
[2d2b8e6]1#
2# Copyright (c) 2011 Petr Koupy
3# Copyright (c) 2011 Jiri Zarevucky
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# - Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# - Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution.
15# - The name of the author may not be used to endorse or promote products
16# derived from this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29
30USPACE_PREFIX = ../..
31LIBRARY = libposix
[965c250]32
[ea4910b]33EXTRA_CFLAGS = -Iinclude/posix -D_XOPEN_SOURCE
[965c250]34
[2660ee3]35EXPORT_FILES = \
36 ../math/libmath.a \
37 ../clui/libclui.a \
[b501de7]38 ../gui/libgui.a \
39 ../draw/libdraw.a \
40 ../softrend/libsoftrend.a \
41 ../hound/libhound.a \
42 ../pcm/libpcm.a \
[bc56f30]43 ../cpp/libcpp.a \
[ba3841e2]44 $(LIBC_PREFIX)/libc.a \
[2eadda9]45 $(LIBC_PREFIX)/crt0.o \
46 $(LIBC_PREFIX)/crt1.o \
[ec9aadd]47 $(LIBRARY).a
[2660ee3]48
[2d2b8e6]49SOURCES = \
[df2e5514]50 src/ctype.c \
51 src/dlfcn.c \
52 src/fcntl.c \
53 src/fnmatch.c \
54 src/locale.c \
55 src/pthread/condvar.c \
56 src/pthread/keys.c \
57 src/pthread/mutex.c \
58 src/pthread/threads.c \
59 src/pwd.c \
60 src/signal.c \
61 src/stdio.c \
62 src/stdlib.c \
63 src/string.c \
64 src/strings.c \
65 src/sys/mman.c \
66 src/sys/stat.c \
67 src/sys/wait.c \
68 src/time.c \
69 src/unistd.c
[2d2b8e6]70
[eeb23f2d]71TEST_SOURCES = \
72 test/main.c \
[4e6a610]73 test/stdio.c \
74 test/stdlib.c \
75 test/unistd.c
76
77EXTRA_TEST_CFLAGS = -Wno-deprecated-declarations
[eeb23f2d]78
[2660ee3]79EXPORT_CPPFLAGS = \
[9b8be79]80 -isystem $$(HELENOS_EXPORT_ROOT)/include/posix \
81 -isystem $$(HELENOS_EXPORT_ROOT)/include/libc \
82 -idirafter $$(HELENOS_EXPORT_ROOT)/include \
[ec9aadd]83 $(COMMON_CPPFLAGS)
[2660ee3]84
85EXPORT_LDFLAGS = \
[fc0b2a8]86 -L$$(HELENOS_EXPORT_ROOT)/lib \
[2eadda9]87 $$(HELENOS_EXPORT_ROOT)/lib/crt0.o \
88 $$(HELENOS_EXPORT_ROOT)/lib/crt1.o
[2660ee3]89
[ea42e44]90EXPORT_LDLIBS = \
[954c024]91 -Wl,--start-group -lposix -lmath -lc -lgcc -Wl,--end-group
[ea42e44]92
[2660ee3]93EXPORT_CFLAGS = \
[ec9aadd]94 $(COMMON_CFLAGS)
[2660ee3]95
[bc56f30]96EXPORT_CXXFLAGS = \
97 $(COMMON_CXXFLAGS)
98
[2d2b8e6]99include $(USPACE_PREFIX)/Makefile.common
100
[b501de7]101export: $(EXPORT_DIR)/config.mk $(EXPORT_DIR)/config.rc \
102 $(EXPORT_DIR)/Makefile.common $(EXPORT_DIR)/Makefile.config
[2660ee3]103
104$(EXPORT_DIR)/config.mk: export-libs export-includes
105 echo '# Generated file, do not modify.' >> $@.new
106 echo '# Do not forget to set HELENOS_EXPORT_ROOT.' >> $@.new
[b2aaaa0]107 echo 'HELENOS_CROSS_PATH="$(shell dirname `which $(CC)`)"' >> $@.new
[ea42e44]108 echo 'HELENOS_ARCH="$(firstword $(subst -, ,$(TARGET)))"' >> $@.new
[2660ee3]109 echo 'HELENOS_TARGET="$(TARGET)"' >> $@.new
110 echo 'HELENOS_CPPFLAGS="$(EXPORT_CPPFLAGS)"' >> $@.new
111 echo 'HELENOS_CFLAGS="$(EXPORT_CFLAGS)"' >> $@.new
[bc56f30]112 echo 'HELENOS_CXXFLAGS="$(EXPORT_CXXFLAGS)"' >> $@.new
[2660ee3]113 echo 'HELENOS_LDFLAGS="$(EXPORT_LDFLAGS)"' >> $@.new
[ea42e44]114 echo 'HELENOS_LDLIBS="$(EXPORT_LDLIBS)"' >> $@.new
[2660ee3]115 mv $@.new $@
116
117$(EXPORT_DIR)/config.rc: $(EXPORT_DIR)/config.mk
118 sed 's:$$(HELENOS_EXPORT_ROOT):$$HELENOS_EXPORT_ROOT:g' < $< >$@
119
[b501de7]120$(EXPORT_DIR)/Makefile.common: ../../../Makefile.common
121 cp $< $@
122
123$(EXPORT_DIR)/Makefile.config: ../../../Makefile.config
124 cp $< $@
125
[2660ee3]126export-libs: $(EXPORT_FILES) export-includes
127 mkdir -p $(EXPORT_DIR)/lib
128 cp -L $(EXPORT_FILES) $(EXPORT_DIR)/lib
129
[a18da67]130export-includes: $(shell find ./include ../c/arch/$(UARCH)/include $(ROOT_PATH)/abi/include -name '*.h')
[2660ee3]131 mkdir -p $(EXPORT_DIR)/include
132 rm -rf $(EXPORT_DIR)/include.new
[9b8be79]133 cp -r -L -T ./include $(EXPORT_DIR)/include.new
134 cp -r -L ../c/arch/$(UARCH)/include/libarch $(EXPORT_DIR)/include.new/libc
[2660ee3]135 cp -r -L $(ROOT_PATH)/abi/include/* $(EXPORT_DIR)/include.new
136 mkdir -p $(EXPORT_DIR)/include.new/libclui
137 cp -L ../clui/tinput.h $(EXPORT_DIR)/include.new/libclui
138 rm -rf $(EXPORT_DIR)/include
[b501de7]139 mkdir -p $(EXPORT_DIR)/include.new/libdraw
[2bb6d04]140 cp -r -L -t $(EXPORT_DIR)/include.new/libdraw ../draw/include/*
[b501de7]141 mkdir -p $(EXPORT_DIR)/include.new/libgui
142 cp -L -t $(EXPORT_DIR)/include.new/libgui ../gui/*.h
143 mkdir -p $(EXPORT_DIR)/include.new/libhound
144 cp -r -L -t $(EXPORT_DIR)/include.new/libhound ../hound/include/*
145 mkdir -p $(EXPORT_DIR)/include.new/libpcm
146 cp -r -L -t $(EXPORT_DIR)/include.new/libpcm ../pcm/include/*
[bc56f30]147 mkdir -p $(EXPORT_DIR)/include.new/libcpp
148 cp -r -L -t $(EXPORT_DIR)/include.new/libcpp ../cpp/include/*
[2660ee3]149 mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include
Note: See TracBrowser for help on using the repository browser.