mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-02 07:30:50 +00:00
posix
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@632 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
dnl $Id$
|
||||
ifdef([build_opengl],[new_object([src/widget/opengl.c])dnl
|
||||
new_example([examples/gldemos/boing],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/clock],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/cube],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/gears],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/triangle],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/tripaint],[],[],[gl_lib])dnl
|
||||
new_example([examples/gldemos/boing],[],[],gl_lib)dnl
|
||||
new_example([examples/gldemos/clock],[],[],gl_lib)dnl
|
||||
new_example([examples/gldemos/cube],[],[],gl_lib)dnl
|
||||
new_example([examples/gldemos/gears],[],[],gl_lib)dnl
|
||||
new_example([examples/gldemos/triangle],[],[],gl_lib)dnl
|
||||
new_example([examples/gldemos/tripaint],[],[],gl_lib)dnl
|
||||
])dnl
|
||||
|
||||
@@ -5,6 +5,7 @@ include(m4/util/arg.m4)dnl
|
||||
include(m4/util/foreach.m4)dnl
|
||||
include(m4/util/comma.m4)dnl
|
||||
include(m4/util/default.m4)dnl
|
||||
include(m4/util/afterdot.m4)dnl
|
||||
include(m4/util/my_syscmd.m4)dnl
|
||||
dnl
|
||||
default_define([cc],[gcc])dnl
|
||||
@@ -23,9 +24,8 @@ define([executable_suffix],[])dnl
|
||||
dnl
|
||||
define([library_targets],[])dnl
|
||||
define([library_objects],[])dnl
|
||||
define([new_object],[pushdef([source])define([source],patsubst(patsubst(patsubst(my_syscmd([sh -c "ls -d $1"]),[\..+$],object_suffix),[
|
||||
],[ ]),[ $],[]))define([library_targets],ifelse(library_targets,[],[source],[library_targets source]))popdef([source])])dnl
|
||||
define([print_library_targets],[foreach(x,space_to_comma(library_targets),[pushdef([source])define([source],[patsubst(x,[\]object_suffix[$],[.c])])dnl
|
||||
define([new_object],[pushdef([object])define([object],afterdots(my_syscmd([sh -c "ls -d $1"]),[object_suffix]))define([library_targets],ifelse(library_targets,[],[object],[library_targets object]))popdef([object])])dnl
|
||||
define([print_library_targets],[foreach([x],space_to_comma(library_targets),[pushdef([source])define([source],afterdot(x,[.c]))dnl
|
||||
x: source
|
||||
$(CC) -c -fPIC $(CFLAGS) $(INCDIR) -o x source
|
||||
popdef([source])])])dnl
|
||||
@@ -35,12 +35,12 @@ define([new_example],[define($1[]_cflag,[$2])dnl
|
||||
define($1[]_ldflag,[$3])dnl
|
||||
define($1[]_lib,[$4])dnl
|
||||
define([examples_targets],ifelse(examples_targets,[],[$1[]executable_suffix],[examples_targets $1[]executable_suffix]))])dnl
|
||||
define([print_examples_targets],[foreach(x,space_to_comma(examples_targets),[pushdef(base)dnl
|
||||
define([base],patsubst(x,[\..+$],[]))dnl
|
||||
define([print_examples_targets],[foreach([x],space_to_comma(examples_targets),[pushdef([base])dnl
|
||||
define([base],afterdot(x,[]))dnl
|
||||
x: base[]object_suffix library
|
||||
$(CC) -L src -Wl,-R./src $(LIBDIR) indir(base[]_ldflag) -o x base[]object_suffix -lMw $(MATH) indir(base[]_lib)
|
||||
$(CC) -L src -Wl,-R./src $(LIBDIR) defn(base[]_ldflag) -o x base[]object_suffix -lMw $(MATH) defn(base[]_lib)
|
||||
base[]object_suffix: base.c
|
||||
$(CC) -c $(INCDIR) -o base[]object_suffix indir(base[]_cflag) base.c
|
||||
$(CC) -c $(INCDIR) -o base[]object_suffix defn(base[]_cflag) base.c
|
||||
|
||||
popdef([base])])])dnl
|
||||
dnl
|
||||
|
||||
11
m4/util/afterdot.m4
Normal file
11
m4/util/afterdot.m4
Normal file
@@ -0,0 +1,11 @@
|
||||
dnl $Id$
|
||||
define([afterdot],[pushdef([rindex])dnl
|
||||
define([rindex],index([$1],[.]))dnl
|
||||
define([rindex],ifelse(rindex,[-1],len([$1]),rindex))dnl
|
||||
substr([$1],[0],rindex)$2[]dnl
|
||||
popdef([rindex])])dnl
|
||||
dnl
|
||||
define([afterdots],[pushdef([first])dnl
|
||||
define([first],1)dnl
|
||||
foreach([x],space_to_comma($1),[ifelse(first,[1],[define([first],0)],[ ])afterdot(x,$2)])dnl
|
||||
popdef([first])])dnl
|
||||
@@ -1,3 +1,5 @@
|
||||
dnl $Id$
|
||||
define([space_to_comma],[_space_to_comma(patsubst([$*],[ ],[,]))])dnl
|
||||
define([_space_to_comma],[ifelse([$#],[0],[],[$#],[1],[$1],[$1[,]_space_to_comma(shift($@))])])dnl
|
||||
define([space_to_comma],[pushdef([rindex])dnl
|
||||
define([rindex],index([$*],[ ]))dnl
|
||||
ifelse(rindex,[-1],[$*],[substr([$*],0,rindex)[,]space_to_comma(substr([$*],eval(rindex + 1)))])[]dnl
|
||||
popdef([rindex])])dnl
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
dnl $Id$
|
||||
define([my_syscmd],[syscmd([$1 > my_syscmd_out.out])include(my_syscmd_out.out)syscmd([sh -c "rm -f my_syscmd_out.out"])])dnl
|
||||
define([my_syscmd],[syscmd([$* | tr '\n' ' ' | sed 's/ $//' > my_syscmd_out.out])dnl
|
||||
include(my_syscmd_out.out)[]syscmd([sh -c "rm -f my_syscmd_out.out"])])dnl
|
||||
|
||||
Reference in New Issue
Block a user